Forum Moderators: not2easy

Message Too Old, No Replies

Is it possible for CSS to specify different colors for multiple links?

Does CSS allow me to create white links and blue links on the same page?

         

Enoch

8:07 pm on Sep 15, 2003 (gmt 0)

10+ Year Member



I have a website where part of the page has white text over a dark red background and the rest of the page has black text on a white background. I would like to create white-colored links (for the dark red background area) and standard blue-colored links (for the white-background area).

In the past, when I have tried using CSS to change link colors, it has ended up affecting the entire page (i.e., all links turning the same color), rather than selectively applying a particular CSS link color to the selected text.

Is there any way to do this with CSS? I am using a WYSIWYG editor (Golive). Any help would be appreciated!

ytswy

8:19 pm on Sep 15, 2003 (gmt 0)

10+ Year Member



Hi Enoch, Welcome to WebmasterWorld!

You can do this quite easily with CSS. Probably the best way is to use descendant selectors.

For example, if you put a div around your different sections, eg:

<div class="wb">
stuff on a white backround
</div>

<div class="rb">
stuff on a dark red backround
</div>

You can then apply different CSS to the sections, eg:

div.wb a:link {
color: blue;
}

div.rb a:link {
color: white;
}

driven_snow

10:50 pm on Sep 15, 2003 (gmt 0)

10+ Year Member



Here is what you need to know do to this : [pageresource.com...] .

The easiest way to have different styles for different parts of the text is to use classes.

Hope this helps.