2 different font colours

TomStutt

Senior Member
Hi, this might sound dumb but never had to do it before.

Is there a way of setting <p> to 2 different colours.

thanks

Tom
 
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.........
 
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.
 
i added a class like levi said and it works nice but if there is a better way to do it then please let me know. thanks all
 
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*/} ?
 
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 */
}
 
Back
Top