4 replies [Last post]
aryastark
Offline
Regular
Last seen: 15 years 16 weeks ago
Joined: 2004-07-22
Posts: 18
Points: 0

hi i have the css as follows:

<style type="text/css">
a
{
font-size: 11px;
color: #99862F;
font-weight: normal;
text-decoration: none;
}

a:active
{
font-size: 11px;
color: #99862F;
font-weight: normal;
text-decoration: none;
}

a:hover

{
font-size: 11px;
color: #745F00;
font-weight: normal;
text-decoration: none;
}

a:visited
{
font-size: 11px;
color: #745F00;
font-weight: normal;
text-decoration: none;
}

.anchor
{
font-size: 11px;
font-color: #99862F;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

.anchor:a
{
font-size: 11px;
font-color: #99862F;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

.anchor:hover
{
font-size: 11px;
font-color: #745F00;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

.anchor:visited
{
font-size: 11px;
font-color: #745F00;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

.linkgrey
{
font-size: 11px;
font-color: #000000;
font-weight: normal;
text-decoration: none;
}

.linkgrey:a
{
font-size: 11px;
font-color: #000000;
font-weight: normal;
text-decoration: none;

}

.linkgrey:hover
{
font-size: 11px;
font-color: #C3B263;
font-weight: normal;
text-decoration: none;
}

.linkgrey:visited
{
font-size: 11px;
font-color: #745F00;
font-weight: normal;
text-decoration: none;
}

.text
{
font-size: 12px;
font-color: #000000;
font-family: Times New Roman,Arial,Verdana,Sans Serif;
}

</style>

somehow, my 'linkgrey' tag doesn't seem to be working. I've put it with the 'a href' tag like this: <td class="linkgrey">- <a href="sp_chelvarrajah.html" class="linkgrey">Chelva R. Rajah
SC</a></td>

now the is blue in color but nowhere on my css is there any blue tags.

can someone help??

thanks much!

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 6 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5342
Points: 2963

~halp! CSS not working for links~

Hi aryastark,
Sometimes using classes can get a little confusing.
The problems the way you have specified .linkgrey:a
Because linkgrey is the class of the td and the link you have few options.

.linkgrey a{} 
a.linkgrey{} 
 
/* then with pseudo classes */ 
  .linkgrey a:hover{} 
a.linkgrey:hover{}
It might be less confusing if you only use the linkgrey class in either the td or the link.

Hope that helps

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 5 years 36 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

~halp! CSS not working for links~

You also need to change the order you declare them in. It should be link, visited, hover, active. That's the w3c recommendation. Some browser don't care but others do.

aryastark
Offline
Regular
Last seen: 15 years 16 weeks ago
Joined: 2004-07-22
Posts: 18
Points: 0

~halp! CSS not working for links~

thanks for the tips. am really new to this so am super confused. is this correct?
<style type="text/css">

a:link
{
font-size: 12px;
color: #000000;
font-weight: normal;
text-decoration: none;
}

a:visited

{
font-size: 12px;
color: #222222;
font-weight: normal;
text-decoration: none;
}

a:hover

{
font-size: 12px;
color: #745F00;
font-weight: normal;
text-decoration: none;
}

a:active
{
font-size: 12px;
color: #000000;
font-weight: normal;
text-decoration: none;
}

a.linkgrey:link
{
font-size: 12px;
font-color: #000000;
font-weight: normal;
text-decoration: none;

}

a.linkgrey:visited
{
font-size: 12px;
font-color: #C222222;
font-weight: normal;
text-decoration: none;
}

a.linkgrey:hover
{
font-size: 12px;
font-color: #C3B263;
font-weight: normal;
text-decoration: none;
}

a.linkgrey:active
{
font-size: 12px;
font-color: #000000;
font-weight: normal;
text-decoration: none;

}

a.anchor:link
{
font-size: 11px;
font-color: #99862F;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

a.anchor:visited
{
font-size: 11px;
font-color: #222222;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

a.anchor:hover
{
font-size: 11px;
font-color: #745F00;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

a.anchor:active
{
font-size: 11px;
font-color: #99862F;
font-family: Arial,Verdana,Sans Serif;
text-decoration: none;
}

a.search:link{font-size: 12px;
font-color: #C3B263;
font-weight: Bold;
font-family: Times New Roman,Arial,Verdana,Sans Serif;
text-decoration: none;}

a.search:visited{font-size: 12px;
font-color: #99862F;
font-weight: Bold;
font-family: Times New Roman,Arial,Verdana,Sans Serif;
text-decoration: none;}

a.search:hover{font-size: 12px;
font-color: #99862F;
font-weight: Bold;
font-family: Times New Roman,Arial,Verdana,Sans Serif;
text-decoration: none;}

a.search:active{font-size: 12px;
font-color: #C3B263;
font-weight: Bold;
font-family: Times New Roman,Arial,Verdana,Sans Serif;
text-decoration: none;}

.text
{
font-size: 12px;
font-color: #000000;
font-family: Times New Roman,Arial,Verdana,Sans Serif;
}

</style>

basically, all my other classes (linkgrey, search) are not working according to the tags i've given them - they all seem to be following the first 4 classes of:
a:link
{
font-size: 12px;
color: #000000;
font-weight: normal;
text-decoration: none;
}

a:visited

{
font-size: 12px;
color: #222222;
font-weight: normal;
text-decoration: none;
}

a:hover

{
font-size: 12px;
color: #745F00;
font-weight: normal;
text-decoration: none;
}

a:active
{
font-size: 12px;
color: #000000;
font-weight: normal;
text-decoration: none;
}

sorry for the mess :oops:

can someone let me know what is wrong now?

arya :?

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 5 years 36 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

~halp! CSS not working for links~

The CSS looks correct - how about the html?