Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS for links

Status
Not open for further replies.

DaZZleD

Programmer
Oct 21, 2003
886
US
hi.

I'm using CSS to customise the way that links look. However when a link is active and I click with the mouse anywhere in the page, it becomes just like a normal link. What am I doing wrong... or is this the default behavior?

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
You can customise different "states" of a link using CSS pseudo-classed. Try this:

Code:
A:link { color: #FF0000; }
A:visited { color: #FF0000; }
A:hover { color: #FF0000; }
A:active { color: #FF0000; }

I guess you might want to change the colour values (unless you want all your links to be bright red ;o)

Hope this helps,
Dan
 
i did that... and it behaves correctly... for example if I select a link it will open a page in an IFrame and it will use the style A:active. however if i click anywhere on the page, it becomes either A:visited or A:link (which look the same to me).

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 

Aaah now I see... Yes - AFAIK, (at least in IE, anyway), when a link loses focus, it goes from being active to visited (or link, depending on if it was actually clicked or not).

Dan
 
ok... thanks

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top