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

Different Link Styles 1

Status
Not open for further replies.

JazzLeg

Programmer
Aug 22, 2002
63
GB
Can anyone tell me how to use more than one style to apply links to appear on one page.

As I have a page where I would like the hyperlinks to use different colours and behave differently on mouse over.

Thanks for reading this.
 
Add this to your styles:
<style>
a.one:link { color: green; text-decoration:none}
a.one:hover { color: white; text-decoration:underline}

a.two:link { color: yellow;}
a.two:hover { color: gold; text-decoration:none }
</style>

The syntax is this:
[tt]a.classname:pseudoclass[/tt] - and there should be NO spaces between them.

Then assign classes to your links in html:

<a href=&quot;&quot; class=&quot;one&quot;> link type1 </a>
<a href=&quot;&quot; class=&quot;two&quot;> link type2 </a>

 
Do also take a look at these threads:

thread215-301168

thread215-307455

thread215-304775

hope this helps,
Erik <-- My sport: Boomerang throwing !!
!! Many Happy Returns !! -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top