CSS issue

R

ricrusso

I cannot understand why I don't get the same result every time on
something simple.
I use a css page for formatting on my own site, www.ricrusso.com.
My links should be green (which they are).
However, they should also be under and overlined when hovering.
Only some links do it. I don't know why.

Here is an example:
http://www.ricrusso.com/sub/pc/pctips.htm

Most links have the under/over line but if you hover down the link
list, you will find some that don't comply. I have not added any
overriding code to cause this.
Thanks in advance,
Ric
 
S

Steve Pugh

ricrusso said:
I cannot understand why I don't get the same result every time on
something simple.
I use a css page for formatting on my own site, www.ricrusso.com.
My links should be green (which they are).
However, they should also be under and overlined when hovering.
Only some links do it. I don't know why.

The one's that don't are the ones that you've already visited.
Here is an example:
http://www.ricrusso.com/sub/pc/pctips.htm

Most links have the under/over line but if you hover down the link
list, you will find some that don't comply. I have not added any
overriding code to cause this.
From your stylesheet (just the relevant rules):

a:link { text-decoration: none; }
a:hover { text-decoration: underline overline; }
a:visited { text-decoration: none;}

When you hover over an unvisited link both the :link and :hover rules
apply. As they have equal specificity the last specified, in this case
:hover, is applied.

When you hover over an visited link both the :visited and :hover rules
apply. As they have equal specificity the last specified, in this case
:visited, is applied.

Place the :hover rule after the :visited rule in your stylesheet.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top