html color codes logo

Using colors through HTML on your website.

Adding colors to your site can liven up your site if used correctly. Below are examples of how you can use a few simple tags to add color to your site.

Changing Font Colors

Changing the color of specific fonts

Code:
<font color="#FF0000">Adding color to text is so simple.</font>

Result:
Adding color to text is so simple.

As you can see the above font color has resulted in a red font color. If you want to add a different color than red then replace the "#FF0000" with the color code of the color that you want.

Note: If you want to change the color of a link you need to place the <font> tags in between the <a> </a> tags.


Changing the color of fonts for the whole page

If you want to change the font text and/or link color of an entire page you'll need to define the colors inside the <body> tag.

Code:
<body text="#000000" link="#0000FF" vlink="#0000AA" alink="#FF0000">

The "text=" code defines the font color of all non-hyperlinked text, "link=" defines the color of unvisited hyperlinked text, "vlink=" (visited link) defines the color of visited hyperlinked text, "alink=" (active link) defines the color the link of hyperlinked text when clicked on.




Changing Background Colors

Changing background color of whole page

If you want to change the background color of an entire page you'll need to define the background color inside the <body> tag.

Code:
<body bgcolor="#CCCCCC">

The "bgcolor=" code defines the background color of the page. It is important to note that you only use one instance of the <body> tag, if you want to define the color of the fonts and background, put all the code inside the same <body> tag.


Changing background color of whole table

If you want to change the background color of an entire table you'll need to define the background color inside the <table> tag.

Code:
<table bgcolor="#000099">

The "bgcolor=" code defines the background color of the table.


Changing background color of table column

If you want to change the background color of only a column within a table you'll need to define the background color inside the <td> tag.

Code:
<td bgcolor="#FFFF00">

The "bgcolor=" code defines the background color of the table column.



  • What are web-safe colors?
  • Simple HTML color chart.
  • HTML color name code chart.
  • How to use colors through HTML on your website.
  • How the hexadecimal system works.
  • Website Color Combinations
  • Website Sponsorship Guide
  • CSS Tags
  • HTML Color Codes Main Page





  • Copyright © 2004-2008 HTMLColorCodes.com.