The Web Just This Site

NM Web Tutorials

Manipulate Text: Text Colour

Lets say you want every single bit of text in your site to be red:

CSS

What The Code Does

 

body {color: #ff0000;}

 

There, no matter what it is that your typing, so long as it is in the body, everything will have red text. Even if I have bold text it will still be the same colour.

The part that says #ff0000 is the HEX colour code, which you already know from using Photoshop and Illustrator, but you may not want to go through the trouble of opening those programs just to get a colour, you can go here instead.

For the selector, I used the <body>. CSS can be used to basically replace certain items. Like if you wanted only your bold text to be coloured blue, you would put
b {color: #0000ff;}. You could do something similar with italicised text if you wanted to.