• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

2 different font colours


Levi

Moderator
Staff member
#2
giving different id's or classes should work iirc and you could also add in the css before the block of text

harry will likely come in with some fancy way of doing it though.........
 

TomStutt

Senior Member
#4
i have some text to go on a white background so i want black text and i have some text to go on a purple background so i want white text.
 

tbwcf

Active Member
#6
presumably the containers which have the background colours already have a class or an id and the paragraph is nested within them?

In witch case .purple p {/*your styles*/} or .white p {/*your styles*/} ?
 
#7
Hi Tom,

You could change this depending on where the paragraph is? so...

If the a paragraph is is an area called content it could be

#content p {
color: #fff;
}

or if the a paragraph is in a side area

#sidebar p {
color: #000;
}

or as levi said, use a class like

<p class="red-text"> Blah blah</p>

in the stylesheet you would have

.red-text {
color: #ff0000; /*red paragraph text */
}