How to Change Font Color (CSS)

By Techwalla Contributor

One of the easiest ways to give your website a little life is to play with the style of the text. To get started, change font colors using CSS.

Step 1

Start with an opening tag. When you have finished your code, end with a closing tag. Copy and paste the tags below to get started:

Everything that you write using CSS must be between these two tags to work.

Step 2

Change your font color. This code makes the text on the entire page change from standard black to whatever color you choose. This code must be between your opening and closing CSS tags:body {color: #HEXCODE;} Replace #HEXCODE with the six-digit hex color code that matches what you want to change your font color to, for example, #FF8800. Include the # sign before the six-digit hex code.

Step 3

Change the font color of sections of text. For instance, create a table and change the font color of the table to differ from the font color for the rest of your website.table {color: #HEXCODE;} Apply font color changes to certain sections of your website using DIVs:#divname {color: #HEXCODE;} Change "divname" to whatever you would like to name your DIV. The # is necessary and should come before the DIV name.

Step 4

Change the font color of one word, one line or one paragraph. For this code, you do not use opening and closing CSS tags; instead, these tags act as their own opening and closing tags, with the different-colored text going in between them.Your text goes here.