View Full Version : selective hyperlink styles

no way
01-05-2003, 11:43 PM
Hi !

I try to change the color of my hyperlinks using for example
a:link {color: #FF0000}
a:visited {color: #00FF00}
a:hover {color: #FF00FF}
a:active {color: #0000FF}
So far no prob.

But I only want to have that in my contents. Is this possible to define this within the paragraph definition I have anyway (links would take these colors in paragraphs)?

<style type="text/css">
font-family: arial;
font-size: 11px;
margin-left: 20px;
margin-right: 20px

Tks for the help in advance

Oh man, I guess i've been to many hours on this this week-end...

01-06-2003, 02:19 AM
i cant think of a way off the top of my head, but you could assign a class to a link.

01-06-2003, 02:42 AM
Wrap your contents in <div class="contents"></div>

and then use this:

.contents a:link {color: #FF0000}
.contents a:visited {color: #00FF00}
.contents a:hover {color: #FF00FF}
.contents a:active {color: #0000FF}

01-06-2003, 04:37 AM
class="" will go into <p> also if thats what you wanted to use.

no way
01-06-2003, 04:40 PM
Ok, it helps me further, thanks to all
What is if I want to assign a class to links? I have tried this way without success:


<style type="text/css">
.mmm a:link {color: #FF0000}
.mmm a:visited {color: #00FF00}
.mmm a:hover {color: #FF00FF}
.mmm a:active {color: #0000FF}



<a href="default.asp" target="_blank" class="mmm">This is a link</a>


Cheers - Fred

01-06-2003, 05:39 PM
<style type="text/css">
A.mmm:link {color: #FF0000;}
A.mmm:visited {color: #00FF00;}
A.mmm:hover {color: #FF00FF;}
A.mmm:active {color: #0000FF;}