HTML Colors:

HTML Colors are used to give a decorative look to your HTML document. Colors can be added to the HTML document, using the BODY tag. In an HTML document you can also use the bgcolor attribute in the body tag to include Colors in your website.

The bgcolor attribute is used to add color to the background of your HTML document.

 

Background Control

The background attribute is used in the body tag to indicate an image file that can be used to tile the background of the HTML document. This will be added to the browser’s display window.

The method to use this tag is as follows:

<body background = “URL of Image that you want to tile the background of HTML document”>

The value that is assigned to the background attribute is the URL of the image you wanted to be the background. This has been done above.

 

HTML Color codes

The HTML Color code provides Color that you can use for your website. Through HTML Color codes you can Color your background, tables, and the text.

In your HTML document you can also specify the Color that you want to use by using the Color name directly. For example you can directly use red, green, blue, etc. There total 16 standard Colors, which you can use to Color the background, text and tables or cells. These standard Colors are as follows:

Navy, white, Black, blue, yellow, fuchsia, red, aqua, maroon, gray, lime, silver, green, olive, purple, teal.

These Colors have HEX and RGB codes or values that are used to include these Colors.

 

HEX Codes

The HEX codes of some of the Colors are as follows:

Color Name HEX Value
White #FFFFFF
Silver #C0C0C0
Gray #808080
Black #000000
Red #FF0000
Maroon #800000
Yellow #FFFF00
Olive #808000
Lime #00FF00
Green #008000
Aqua #00FFFF
Teal #008080
Blue #0000FF
Navy #000080
Fuchsia #FF00FF
Purple #800080

 

These codes can be used as follows

<html>

<h2 style=”background-color:#FF0000″>

Setting Color

</h2>

</html> color