Page 1 of 1

Help me undertand this CSS

Posted: Thu Apr 15, 2004 4:51 am
by JayBird
I have never been brilliant at CSS. I understand all the advantages and really wanna use it more, but can't get my head round it yet.

I have some links that i always want to be blue, whether you are hovering the link or the link has been visited. The only thing i wat to change is when i hover, i want to underline the link.

This is the CSS i have

Code: Select all

a.news
{
	font-family: Tahoma, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #7ABAFA;
}

a.news:link
{
	text-decoration: none;
}

a.news:hover
{
	text-decoration: underline;
}

a.news:visited
{
	text-decoration: none;
}
This works fine and dandy, but when a link has been visited, the font size is slightly smaller than a link that hasn't been clicked.

I thought if i didn't set a font site for a.news:visited, the value would be inherited from a.news?

Thanks

Mark

Posted: Thu Apr 15, 2004 6:56 am
by phait
hmm, technically I think you're right in that it should inherit. what is the browser you're using?

See if this makes any difference..

Code: Select all

a.news 
{ 
   font-family: Tahoma, Arial, Helvetica, sans-serif; 
   font-size: 10px; 
   color: #7ABAFA;
   text-decoration: none;
} 

a.news:hover 
{ 
   text-decoration: underline; 
}
I just moved the text-decoration into the higher level definition to save on code, so all instances of a.news should now have no underlining except for the pseudo class 'hover'.

Do these link definitions differ in size from the value set for the top most 'a' tag. Could it be that it's somehow taking on that font-size instead?