HTML - Bgcolor

The Bgcolor attribute is used to establish the the background color of an paragraph, table or any other parts of the HTML. It is recommended the moderate usage of this tag. It is also recommended establishing the background colors and the text styles or links, with the help of CSS. We will explain in more details how that can be done in a later CSS tutorial.

<"numetag" bgcolor="Value">

This is a model of how the bgcolor attribute will be used within a tag.

<body bgcolor="Silver">

<p>We set the color...</p>

</body>

Display

See this example in a new window.


HTML - Adding color to the tables

The following example shows you how to color a table in many colors, using the 'bgcolor' attribute.

<table>

<tr bgcolor="#FFFF00"><td>This Row is Yellow!</td></tr>

<tr bgcolor="#AAAAAA"><td>This Row is Gray!</td></tr>

<tr bgcolor="#FFFF00"><td>This Row is Yellow!</td></tr>

<tr bgcolor="#AAAAAA"><td>This Row is Gray!</td></tr>

<tr bgcolor="#FFFF00"><td>This Row is Yellow!</td></tr>

<tr bgcolor="#AAAAAA"><td>This Row is Gray!</td></tr>

</table>

Display

See this example in a new window.


HTML - Font and background together

First of all we put into practice an example of a table of scores coloring a table to highlight certain aspects.

<table bgcolor="#000000">

<tr><td bgcolor="#009900">

<font color="#FFFF00" align="right">Green Bay</font></td>

<td><font color="#FFFFFF">30</font></td></tr>

<tr><td bgcolor="#0000FF">

<font color="#DDDDDD" align="right">New England</font></td>

<td><font color="#FFFFFF">11</font></td></tr>

</table>

Display

See this example in a new window.

 

An example of a paragraph on a gray background:

<table bgcolor="#777777">

<tr><td>

<p><font face="Monotype Corsiva, Verdana" size="4" color="#00FF00"> This paragraph tag has... </font></p>

</td></tr>

</table>

 

Display

See this example in a new window.