Click to See Complete Forum and Search --> : Changing link color within the <a> tag itself


couchmonkey
08-21-2003, 11:10 AM
I want to change the color of links in the link tags themselves (would it be correct to say that I want to change them inline?)

This will work:
<a href="blahblahblah.html" style="color:red;">link</a>

But I don't want the link to be red all the time, just when it is unvisited.

I know I could include a small style section at the top of the page, but it seems like the company I'm working for is afraid of CSS: we have a couple of standard stylesheets that are about ten lines long and we're not supposed to modify them at all. So I would like to keep any css I add as simple and small as possible.

gil davis
08-21-2003, 11:15 AM
The only way to control a link's visited color is with a style sheet accessing the pseudo object "A:visited". You cannot get to that object inline.

couchmonkey
08-21-2003, 04:01 PM
That's what I was afraid of! Oh well, thanks for the help!

xataku_nakusute
08-21-2003, 08:07 PM
i cant give you all of the details right now, but you can use javascript and use cookies perhaps to do so...

spufi
08-22-2003, 01:00 PM
Originally posted by couchmonkey
it seems like the company I'm working for is afraid of CSS

And changing the color of text via CSS has been supported since IE 3.0 and NN 4.0, so it's about the safest thing to do in CSS. You kind of have to do some more advance stuff before you really start to run into problems with cross browser issues with CSS.

gizmo
08-22-2003, 02:57 PM
This is the sort of thing I used to rebel against. I would do it in CSS just to show the company how simple it is. Just keep quiet about it and probably no-one will notice. When they do they will think how clever you are.;)