Click to See Complete Forum and Search --> : visited link
Laksh
07-22-2006, 11:39 PM
hi, here is code for a link
<a href="auto_shows/NYC.html" target="extLinks" STYLE="text-decoration:none; font-family: verdana: 11px;color: #666666">NYC</a>
i want this one specific link only to get underlined and change color once it has been clicked, i have searched a lot but everywhere it tells me how to change the color etc of all links on the page
any help on how to change the color and style (underline) of just this one will be greatly appreciated, thanks a lot!
NogDog
07-22-2006, 11:56 PM
Assign an ID to it, for instance "nyc", then apply your visual attributes in your style sheet or <style> block.
<a id="nyc" href="auto_shows/NYC.html" target="extLinks">NYC</a>
CSS:
<style type="text/css">
#nyc:link {text-decoration:none; font-family: verdana: 11px;color: #666666"}
#nyc:visited {text-decoration: underline, color: #cc00cc}
#nyc:hover, #nyc:active {color: #ff0000}
</style>
Laksh
07-23-2006, 12:24 AM
hmmm .. i put this in the head section:
<style type="text/css"> #nyc:visited {text-decoration:underline;} </style>
and this for the link:
<a id="nyc" href="auto_shows/NYC.html" target="extLinks" STYLE="text-decoration:none; font-family: verdana: 11px;color: #666666">NYC</a>
it doesnt work ... dammit!!@#$%^
NogDog
07-23-2006, 12:32 AM
The style="..." attribute within the actual <a> tag will override anything in your style block, thus the need to move it out of there and into the style block.
Laksh
07-23-2006, 12:50 AM
if i do that, then it doesnt even look like what it looked like before ...
is there anything i can do using "onclick" (i may have to sue some javascript i guess in the head section) to simply change the original link in some way or the other (color, size, etc etc) css isnt working on the following code:
head section:
<style type="text/css">
a#nyc:link {text-decoration:none; font-family: verdana: 11px; color: #666666; text-decoration:none; font-weight:bold}
a#nyc:visited {text-decoration: underline; color: #000000}
</style>
link:
<span class="style53"><a id="nyc" href="auto_shows/NYC.html" target="extLinks">NYC</a>
NogDog
07-23-2006, 01:24 AM
Try this, just using "a#nyc" (without the ":link" pseudo-class) to define the default appearance, then specify the differences with the ":visited" pseudo-class:
a#nyc {font-family: verdana; font-size: 11px; color: #666666; text-decoration:none; font-weight:bold}
a#nyc:visited {text-decoration: underline; color: #000000}
There were a couple syntax errors I fixed, too.
Laksh
07-23-2006, 08:57 AM
hi nogdog, this code still isnt working, im doing eveything else right - i know it, thres something messed up somewhere else ... lets seeeee, ill work on it some more
thanks a lot for the help, really appreciate it!
Charles
07-23-2006, 10:30 AM
i know it, thres something messed up somewhere elseTHe first step is to make certain that your page passes The Validator (http://validator.w3.org/). Then run it through The Other Validator (http://jigsaw.w3.org/css-validator/). If all else fails then post the URL. Sometimes it just takes a fresh look.
Laksh
07-23-2006, 10:37 AM
hmm, yes, lots of stuff is screwed up ... hahaha
im looking into it
thanks man