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!

Different colored hyperlinks

Status
Not open for further replies.

trent101

Programmer
Nov 4, 2005
50
AU
Hey,

I have a problem on my site where I would like the color of one set of links to be different to the color of another.

For instance, the 'mini menu' down the bottom is on a dark background, so i would like them to be white in color.

However the rest of the main content is on a white background, so if I specify this in my style sheet:

A:link
{
color...
}

A:visited
{
color....
}


it does make my mini menu links white but also makes all the other links white to!

Is there any way to fix this so only my links down the bottom are white?

Cheers.
 
assign classes to your links.
Code:
<style>a:link.class1{color:green;} 
a:link.class2{color:black;}</style>

<a class = class1 href = blah.com> green link</a> 
<a class = class2 href = blah1.com> black link</a>
<a class = class1 href = blah2.com> another green link</a>
<a class = class2 href = blah3.com> black link</a>

Glen
 
Hi

Assuming that your mini menu is in a [tt]div[/tt] like this :
Code:
<html>
<head>

<style type="text/css">
[green]a:link {
  color: red;
}
a:visited {
  color: maroon;
}[/green]
[blue]#minimenu a:link {
  color: white;
  background-color: navy;
}
#minimenu a:visited {
  color: silver;
  background-color: navy;
}[/blue]
</style>

</head>
<body>

[green]<a href="#">one</a>
<a href="#">two</a>
<a href="">three</a>[/green]

<div id="minimenu">
[blue]<a href="#">one</a>
<a href="#">two</a>
<a href="">three</a>[/blue]
</div>

</body>
</html>

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top