Click to See Complete Forum and Search --> : Link Rollovers...


Paul Jr
08-12-2003, 11:56 AM
Is there a way to affect only a specified group of links with the following code?


<STYLE TYPE="text/css">
a:link { color: blue; text-decoration: none }
a:active { color: red; text-decoration: none }
a:visited { color: blue; text-decoration: none }
a:hover { color: green; text-decoration: underline }
</STYLE>


The code normally affects every link on the page.

pyro
08-12-2003, 11:59 AM
Set a class on the links, and then set up your CSS like this:

<style type="text/css">
a.links:link { color: blue; text-decoration: none }
a.links:active { color: red; text-decoration: none }
a.links:visited { color: blue; text-decoration: none }
a.links:hover { color: green; text-decoration: underline }
</style>
</head>
<body>
<p><a href="http://www.w3c.org" class="links">Link with CSS</a></p>
<p><a href="http://www.w3c.org">Link without CSS</a></p>

Paul Jr
08-12-2003, 01:06 PM
Okay, thanks. I should have known it would be something like that, but I'm really new to CSS.

pyro
08-12-2003, 01:20 PM
No problem... Happy to help. :)