September 15th, 2003, 02:46 PM
-
Is it possible for CSS to specify different colors for multiple links?
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).
Is there any way to do this with CSS? I am using a WYSIWYG editor (Golive). Any help would be appreciated!
Last edited by Enoch; September 15th, 2003 at 02:55 PM.
September 15th, 2003, 03:09 PM
-
Search this forum for 'pseudoclasses'. I remember a good example being posted here somewhere.
October 24th, 2003, 06:21 AM
-
same question....
and the search for 'pseudoclasses' brought up nothing.....
I am totally new to the world of CSS but have decided to take the plunge. I am setting up the site to use external style sheets and I've been trying to find the answer in tutorials on the web but can't seem to find what I am looking for. Mind you I'm looking for a lot since at the mo. I really am a bit lost with the whole thing - I just figured that I should dive right in and learn as I go. Anyway that's a whole other story (but if one of you knows of a tutorial that really gets us that are wet behind the ear up and running..........)
Please help.....
jim
October 24th, 2003, 06:42 AM
-
October 24th, 2003, 07:54 AM
-
Re: Is it possible for CSS to specify different colors for multiple links?
Originally posted by Enoch
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).
Is there any way to do this with CSS? I am using a WYSIWYG editor (Golive). Any help would be appreciated!
Well, what you're gonna want to do is use the above suggestions, and use the following type setup:
Let's say we have the following code:
PHP Code:
<div class="darkredBG">
This is a division with a dark red background and white text.
</div>
<div class="normalBG">
This is a white background with black text. You could also define this style as pertaining to the <body> tag.
</div>
.
SO, the CSS is gonna look like this:
PHP Code:
/* Style for the actual div */
.darkredBG {
background-color : #800;
color : #fff;
}
/* Style for the links inside that div */
.darkredBG a:link {
color : #fff;
background-color : transparent;
}
.normalBG {
background-color : #fff;
color : #000;
}
.normalBG a:link {
color : #00f;
background-color : transparent;
}
I think that'll do it!
October 24th, 2003, 08:32 AM
-
Thanks a lot guys - I'll have a go at those suggestions.......
cheers,
jim
October 24th, 2003, 09:35 AM
-
Re: same question....
Originally posted by billybonds
and the search for 'pseudoclasses' brought up nothing.....
Sorry 'bout that. It should be two words: 'pseudo classes'