PDA

View Full Version : 2 link styles, same page


dvduval
24-02-2002, 12:11/12:11PM
I am having a little trouble with CSS.

I am attaching a style sheet that contains:

a:link {color: #FFFFFF; text-decoration:
none; ; font-family: Geneva, Arial, Helvetica, san-serif; font-weight: bold; cursor: hand}
a:visited {color:#FFFFFF; text-decoration: none}
a:active {color:violet; text-decoration: none}
a:hover {color:red; background: #CCCCCC}

But later down on the page I don't want this style sheet to mess with my links. I'm sure there is a simple solution, but I'm still learning and haven't found it yet.

ihelpyou
24-02-2002, 12:42/12:42PM
I think if you put the attribute at the link point in the body it will override any style sheet you are using. Someone will correct me if wrong.

JuniorHarris
24-02-2002, 13:28/01:28PM
I believe you are correct sir!

You should also be able to define two style classes [within the sheet] as well, and specify a class= on your anchor tag to use the appropriate class. The style sheet code might appear as the following:BODY A.class-one:link
{
COLOR: #ffffff;
TEXT-DECORATION: none
}

BODY A.class-two:link
{
COLOR: #ee82ee;
TEXT-DECORATION: none
}A sample anchor tag might appear as:<a href="http://www.blah.com/" class="class-one">Where class-one and class-two are the class names which you define. Also I think it is better to use the color codes, as some older browsers may not translate color names properly.

dvduval
24-02-2002, 20:56/08:56PM
That is exactly what I was looking for, JuniorHarris!
Thank you.

JuniorHarris
24-02-2002, 21:40/09:40PM
No problem!~;)