HTML Tutorial Example
Example
HTML Tags
HTML Basic
HTML Introduction
HTML Start
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Formatting Elements
HTML Color Codes
HTML Font
HTML Links
HTML Style
HTML Text Links
HTML Entities
HTML Email
HTML Images
HTML Image Links
HTML Forms
HTML Tables
HTML Bgcolor
HTML Background
HTML Color Chart
HTML Frames
HTML Layouts
HTML Comments
HTML Meta
HTML Script
HTML Special Tags
HTML Body
HTML Div
HTML Formatting Tags
HTML Bold
HTML Italic
HTML Code
HTML Pre
HTML Superscript
HTML Subscript
HTML Strikethrough
HTML Forms
HTML Input Tags
HTML Text Fields
HTML Password
HTML Checkboxes
HTML Radio
HTML Textareas
HTML Upload
HTML Select
HTML Submit
HTML Reset
HTML Hidden Fields
HTML References
HTML Events
HTML Character Sets
HTML Symbols
HTML ASCII
The bgcolor attribute is used to control the background of an HTML elmement, specifically page and table backgrounds. Bgcolor can be placed within several of the HTML tags. However, we suggest you only use it for your page's main background (<body>) and in tables. For additional background styling, check out CSS Backgrounds. The HTML to change the background color is simple:
<body bgcolor="Silver">
<p>We set the background...</p>
</body>
background Silver
This example shows how to add a background color for an entire table using generic values of color.
<table bgcolor="lime" border="1"><tr>
<td>A lime color table background using .</td>
</tr></table>
<table bgcolor="#ff0000" border="1"><tr>
<td>A red colored table background using hexadecimal values "#FF0000".</td>
</tr></table>
<table bgcolor="rgb(0, 0, 255)" border="1"><tr>
<td>A blue colored table background using RGB values "rgb(0, 0, 255)".</td>
</tr></table>
| A lime colored table background. |
| A red colored table background using hexadecimal values '#FF0000'. |
| A blue colored table background using RGB values 'rgb(0, 0, 255)'. |
Here's a few common examples of "bgcolor" and font color
<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>
| This Row is Yellow! |
| This Row is Gray! |
| This Row is Yellow! |
| This Row is Gray! |
| This Row is Yellow! |
| This Row is Gray! |
Check out this "Scoreboard" we made with the use of font color and bgcolor!
<table bgcolor="#000000">
<tr><td bgcolor="#009900">
<font color="#FFFF00" align="right">Green Bay</font></td>
<td><font color="#FFFFFF">13</font></td></tr>
<tr><td bgcolor="#0000FF">
<font color="#DDDDDD" align="right">New England</font></td>
<td><font color="#FFFFFF">27</font></td></tr>
</table>
| Green Bay | 13 |
| New England | 27 |
Changing the bgcolor in different ways

