Change font colour using css

April 23rd, 2008

Where did that red text come from?

Oikofugic Design

From the cascading style sheet

You might need to set youeself a style sheet at this point

Formatting text using css, we all know the basics, for example how to change the colour of a h2 tag.
Use the property color.

h2 {color: red;} in a named value or below as a hex value h2 {color: #dd0000;}

If you want to mix it up a little and change the color of one word within the text you can enclose it in a span tag and style accordingly.

<span class="green">Inserted words</span>

CSS

.green {color: green;}

Next time: We look at font-family, how your text is seen by the browser.


Entry Filed under: CSS Reaction

3 Comments Add your own

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Most Recent Posts