loyaliser
asked on
over-riding css style for anchor tags
in a .css file i have defined anchor properties (hover, visited etc.)
how can i over-ride these settings in certain parts of an html page that uses this .css file?
e.g. use different hover colors etc.
thanks.
how can i over-ride these settings in certain parts of an html page that uses this .css file?
e.g. use different hover colors etc.
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just specify a different class for each section of the page then you do not have to specify a class for each link:
<html>
<title> multi-links </title>
<head>
<style media="screen" type="text/css">
.class1 a:link { color: blue }
.class1 a:visited { color: blue }
.class1 a:hover { color: blue}
.class2 a:link { color: white }
.class2 a:visited { color: white }
.class2 a:hover { color: white }
</style>
</head>
<body>
<div class="class1">
... content for the first part of the page ...
<div class="class2">
... content for the second part of the page
</div>
</font>
</body>
</html>
The div wrapped around the links for each section of the page will cause the links in that section to inherit the specification contained in that class.
Cd&
<html>
<title> multi-links </title>
<head>
<style media="screen" type="text/css">
.class1 a:link { color: blue }
.class1 a:visited { color: blue }
.class1 a:hover { color: blue}
.class2 a:link { color: white }
.class2 a:visited { color: white }
.class2 a:hover { color: white }
</style>
</head>
<body>
<div class="class1">
... content for the first part of the page ...
<div class="class2">
... content for the second part of the page
</div>
</font>
</body>
</html>
The div wrapped around the links for each section of the page will cause the links in that section to inherit the specification contained in that class.
Cd&
ASKER
that's the ticket!
thanks...
thanks...
.myclass{text-decoration:n
.myclass:hover{text-decora