Problem with link style

This is a discussion on "Problem with link style" within the Web Page Design section. This forum, and the thread "Problem with link style are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 11th, 2007, 13:12
Junior Member
Join Date: Jun 2007
Location: India
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with link style


Hi,
I have created a HTML with stylesheet
Code: Select all
<style>
    #button {
width:50px;
}
    .button
{
background-color :EC870E;
FONT-SIZE: 8pt;
color: #FFFFFF;
FONT-FAMILY: Arial, Helvetica, Sans-Serif;
font-weight: bold;
height : 16pt;
}
.contentBody
{
    FONT-WEIGHT: normal;
    FONT-SIZE: 10pt;
    COLOR: #000000;
    FONT-FAMILY: Arial, Helvetica, sans-serif
}
.LegendText
{
    FONT-WEIGHT: normal;
    FONT-SIZE: 8pt;
    COLOR: black;
    FONT-FAMILY: Arial, Helvetica, Sans-Serif;
}
.FormMargin
{
     margin-right: 10px;
    margin-left: 10px;
 }
    </style>
and i am using class to call this styles. its working fine.
But My friend says to create same look & feel without style tags.
So, i have removed CSS codings. and alternatively i have used:
Code: Select all
<table title="Related Links" width="185" border="0" cellpadding="0" cellspacing="0" Style="BORDER-RIGHT: #666666 1px solid; PADDING-RIGHT: 0.1em; BORDER-TOP: #666666 1px solid;
    PADDING-LEFT: 0.1em; FONT-SIZE: 8pt; PADDING-BOTTOM: 0.1em; BORDER-LEFT: #666666 1px solid; COLOR: #000000; PADDING-TOP: 0.1em; BORDER-BOTTOM: #666666 1px solid; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #efefef;">


<font style="FONT-WEIGHT: normal; FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif" >Welcome to my site</font>
These also working fine.

But how can use the following CSS codings and where can i use it?
Code: Select all
A:link
{
    COLOR: #006fa6;
    TEXT-DECORATION: underline
}
A:visited
{
    COLOR: #006fa6;
    TEXT-DECORATION: underline
}
A:active
{
    COLOR: #45adc6;
    TEXT-DECORATION: underline
}
A:hover
{
    COLOR: #45adc6;
    TEXT-DECORATION: underline
}
Please give me your valuable solutions. Thanks

Last edited by karinne; Jul 11th, 2007 at 13:46. Reason: Please use [code]...[/code] tags when displaying code!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 11th, 2007, 13:43
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with link style

I just had a quick look.

Your link styles should be like this:
Code: Select all
a:link { }

a:hover {}

AND NOT
Code: Select all
A:link { }
A:hover { }

You put the CSS within the <head> tags, inside these tags... <style type="text/css"> </style>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 11th, 2007, 13:48
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with link style

That post is a bit confusing but the

Code: Select all
A:link
{
    COLOR: #006fa6;
    TEXT-DECORATION: underline
}
A:visited
{
    COLOR: #006fa6;
    TEXT-DECORATION: underline
}
A:active
{
    COLOR: #45adc6;
    TEXT-DECORATION: underline
}
A:hover
{
    COLOR: #45adc6;
    TEXT-DECORATION: underline
}
is for styling links. So ... in your HTML just a simple link is all it takes.

Also ... like Padraig said, EVERYTHING SHOULD be in lowercase.

You might want to have a look at some tutorials from HTMLDog.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 11th, 2007, 14:36
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with link style

Every line/command/whatever they're called in css must end with a semi-colon( ; ) too. If you miss them out it could mess everything up.

Pete.

Last edited by karinne; Jul 11th, 2007 at 14:42. Reason: Fixed your semi-colon ;)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 11th, 2007, 14:41
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with link style

Oh yes ... although the last line (before the closing } ) does not need a semi-colon( ; ) it's always good practice to just add it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 12th, 2007, 11:08
Junior Member
Join Date: Jun 2007
Location: India
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with link style

Thanks for your suggestion.

I need to use the following CSS codings inside the HTML tags
a:link { COLOR: #006fa6;}
a:visited{ COLOR: #006fa6;}
a:active{ COLOR: #45adc6; }
a:hover{ COLOR: #45adc6;}

Methode one to use the styles
<style>
.BodyText
{
FONT-FAMILY: Arial;
FONT-SIZE: 10pt
FONT-COLOR: #3e63ef;
}
</style>
then we can call this style
<font class="BodyText">Hai</font>

or
Methode Two to use the styles
We can directly give the styles to particular text area
<font style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"> Hai</font>

I need to use a.link styles in the Method two way.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jul 12th, 2007, 12:04
Up'n'Coming Member
Join Date: Jun 2007
Location: Birmingham, UK
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with link style

Quote:
Originally Posted by jayaramgussy View Post
I need to use a.link styles in the Method two way.
AFAIK there is no way of doing that.

And why do you want to do it. The first section of the "CSS Techniques for Web Content Accessibility Guidelines" on the W3C website reads:
Use a minimal number of style sheets for your site
Use linked style sheets rather than embedded styles, and avoid inline style sheets.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jul 12th, 2007, 12:25
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with link style

First of all the font element is deprecated so ... forget about using that.

If you want to apply a different color to certain links, then look at the CSS Beginner FAQ that a sticky in this section. There's one question "How do I get some links to look different than other links"

I think that's what you are looking for.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css links problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a style sheet to an RSS feed problem Andrew1986 Other Programming Languages 5 Feb 19th, 2008 10:31
<li> problem :: How to make appear list-style-image while choosing display:inline sayamish Web Page Design 2 Oct 21st, 2007 05:19
CSS Print Style Sheet Problem bennyboy7 Web Page Design 1 Aug 14th, 2007 08:58
How to tell IE7 to use a pariticular style in a single style sheet figo2476 Web Page Design 5 May 25th, 2007 14:23


All times are GMT. The time now is 18:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42