See which Web Hosts BuildThe.com has reviewed and recommends >>

CSS Colors in action

If you're not using style sheets in your web design you should be. They centralize the layout and display data into one place, making future updates much easier since you'll only have to edit a single file instead of each page separately, and they tend to speed up page loading for your visitors. Of the many uses for your style sheet, defining the colors of various page elements and fonts is what you'll do a lot of, so here's a brief overview of making use of CSS Colors.

First, there are 16 named colors (colors you may define by name rather than Hex or RGB values):
white
silver
gray
black
aqua
blue
purple
navy
lime
olive
teal
green
yellow
fuchsia
red
maroon

To use any of these in your CSS, you would simply write it like so:

p {
color: red;
}

That would make the text font in all of your paragraphs red. Much easier than having to add "font color" tags to each page of your web site isn't it?

If you keep your site designs to a basic with a minimalist approach you may be able to just memorize this list and be fine. However, most people will want to use colors beyond those 16 at some point, and why not when there are thousands to pick from and most modern monitors are able to display them all?

To use a color which isn't among the 16 named, you would need to find its Hex or RGB value. The easiest way to do this is from a CSS Colors chart.

Having the Hex value for the color you want to use, you would simply write your CSS like so:

p {
color: #ff0000;
}

Once again, that code would make all of your text in paragraphs red. To pick another color, you would just replace the "ff0000" with its Hex value.