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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do inline CSS A:visited ? 1

Status
Not open for further replies.

Sheco

Programmer
Jan 3, 2005
5,457
0
0
US
What is the syntax for setting inline style of the visited pseudo-class?

I mean something like:[tt]
<a href="#" style="[red]??????[/red]">click here</a>[/tt]

What can I put in place of the the red question marks to define the visited style for this one link only?


 
You can't define styles for the state of an object inline.

You either need to do it in an external CSS style sheet. Or in a style block in the same page.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Bleh, I was afraid of that. [sadeyes]
 
for this one link only?

To expand on Chris's answer, if you know it's going to be for that one link only, then it would probably be a better idea to give the anchor an id, and assign the style by referencing that id:
Code:
<style type="text/css">
a[!]#[/!]special:visited { color: red; }
</style>
<a href="#" [!]id[/!]="special">click here</a>
I find classes to be better suited for styles that need to be applied to a select few elements. For individual styles I just reference that element's id.


-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top