HTML - The bgcolor Attribute
The bgcolor attribute is used to set the background color of an HTML element. Bgcolor is one of those attributes that has become deprecated with the implementation of Cascading Style Sheets. The reason we've included it in this tutorial is because it will give us an opportunity to introduce web colors and also add some life to our HTML web page as we continue to progress through this tutorial. It will serve as a visual aid for you as you are learning the mechanics of building a table.
Without much effort, we can bring that boring white web page to life by adding some color with the bgcolor attribute.
HTML Bgcolor Code
<body bgcolor="silver">
<p>This page now has a Green background!</p>
</body>
HTML Bgcolor
This page now has a GREEN background!
|
HTML - Web Colors
Our example uses the text value, which is one of three different types of color values that can be used with the bgcolor attribute. Below is a table of the 16 basic HTML color values that are available to HTML web designers.
HTML Basic Colors
| Black | | Gray | | Silver | | White |
| Yellow | | Lime | | Aqua | | Fuchsia |
| Red | | Green | | Blue | | Purple |
| Maroon | | Olive | | Navy | | Teal |
While the table above illustrates only 16 colors, 16 is surely not the limit to our color wheel. As we mentioned, HTML supports three different types of color values including text values (which we've pretty much covered above), numeric, (RGB) and hexadecimal values. We'll go into more detail regarding these values so just sit tight. This next example offers a sneak peak at what these values may look like.