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

different link colours 2

Status
Not open for further replies.

boroski

Programmer
May 29, 2005
5
0
0
GB
I am building a css file, and want to have different colour links in the header to the rest of the page.

How can i define eg
a.hover (in header){
color = #fff000;
}
and
a.hover (rest of page){
color = #000000;
}

many thanks
 
Use classes;
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<html lang="en">
	<head>
<style>
a:hover.top{
color:red;}
a:hover.bot{
color:green;}

</style>
	</head>
	<body >


<a href="test"[COLOR=red] class = "top"[/color]>test2</a>
<a href="test1"[COLOR=red] class = "bot"[/color]>test1</a>
	</body>
</html>

Glen
 
many thanks

is it possible in css to change the underline thickness for links?

cheers
 
boroski said:
is it possible in css to change the underline thickness for links?
Not really but you can turn off the underline and work with the border. Border is fully customizable:
Code:
a {
  text-decoration: none;
  border-bottom:  2px solid blue;
}
As an addendum, if possible Chris' solution should be better than using separate glasses. As for Glen's solution, it uses the incorrect syntax. First it is element (a) then class (top) and then state (hover). Correct version of his code would look:
Code:
a.top:hover { color:red; }
a.bot:hover { color:green; }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top