Online Reference

 

 

HTML REFERENCE
RAPID TABLES

 

    Home > Web Design > HTML Reference > HTML Color

HTML Color

HTML Color Tags and Attributes

HTML TagHTML AttributeDescription
<body>bgcolorpage background color
<table>bgcolortable background color
<tr>bgcolortable row background color
<th>bgcolortable header cell background color
<td>bgcolortable data cell background color
<body>textpage text color
<font>colortext color
<table>bordercolortable border color
<tr>bordercolortable row border color
<th>bordercolortable header cell border color
<td>bordercolortable data cell border color
<table>bordercolorlighttable light border color
<tr>bordercolorlighttable row light border color
<th>bordercolorlighttable header cell light border color
<td>bordercolorlighttable data cell light border color
<table>bordercolordarktable dark border color
<tr>bordercolordarktable row dark border color
<th>bordercolordarktable header cell dark border color
<td>bordercolordarktable data cell dark border color
<style>-Define CSS style
<body>linklinks color
<body>vlinkvisited links color
<body>alinkselected links color

HTML Code Example

HTML has its own color attributes, but It is better to use CSS Color styling.

Example:

<p><font color="#FF0000">Red Text</font></p>

<p><font color="green">Green Text</font></p>

<p><font color="rgb(0,0,255)">Blue Text</font></p>

Red Text

Green Text

Blue Text

HTML Background Color - <body>, <table>, <tr>, <th>, <td> tags

The bgcolor attribute is used with the <body>,<table>,<tr>,<th>,<td> tags.

The page background color is set in the <body> tag in one of the three formats below.

The table and table cells background colors are set like the example below:

Example:

<body bgcolor="#808080">

<body bgcolor="gray">

<body bgcolor="rgb(128,128,128)">

<table border="1" width="100%" bgcolor="#FFFF00">
<tr>
   <th bgcolor="#808000">&nbsp;</th>
   <th>&nbsp;</th>
</tr>
<tr>
   <td>&nbsp;</td>
   <td bgcolor="#DDDDDD">&nbsp;</td>
</tr>
<tr bgcolor="#00FFFF">
   <td>&nbsp;</td>
   <td>&nbsp;</td>
</tr>
</table>

HTML Text Color - <text>, <font> tags

Example:

<body text="#000000">

<h1><font color="#000000">Black Text Color</font></h1>

<p><font color="#FF0000">Red Text Color</font></p>

HTML Table Color - <table>, <tr>, <th>, <td> tags

Example:

<table border="1" width="100%" bgcolor="blue" bordercolor="#000000" bordercolorlight="#008000" bordercolordark="#FF00FF">
<tr>
<th bgcolor="#808080" bordercolorlight="#008000" bordercolordark="#808000" bordercolor="#000000">&nbsp;</th>
<th >&nbsp;</th>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#808080" bordercolorlight="#008000" bordercolordark="#808000" bordercolor="#000000">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#808080" bordercolorlight="#00ffff" bordercolordark="#ffff00" bordercolor="#ffffff">
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

HTML Style Color

style attribute

The style attribute is used to define CSS styling inside a specific HTML tag.

Example:

<html>

<head>

</head>

<body>

    <p style="color: #00FF00">Some green words</p>

    <p style="color: #0000FF">Some blue words</p>

</body>

</html>

style tag

The <style> tag is used to define CSS styling in the head section.

Example:

<html>

<head>

    <style type="text/css">

        p { color: #00FF00; }

    </style>

</head>

<body>

    <p>Some green words</p>

</body>

</html>

HTML Link Color - <a>, <font> tags

Example:

<a href="other_page.htm">

    <font color="#008000">Green link color</font>

</a>

HTML Color Names and Codes Table

 black#000000rgb(0,0,0)
 silver#C0C0C0rgb(192,192,192)
 gray#808080rgb(128,128,128)
 white#FFFFFFrgb(255,255,255)
 purple#800080rgb(128,0,128)
 fuchsia#FF00FFrgb(255,0,255)
 maroon#800000rgb(128,0,0)
 red#FF0000rgb(255,0,0)
 olive#808000rgb(128,128,0)
 yellow#FFFF00rgb(255,255,0)
 green#008000rgb(0,128,0)
 lime#00FF00rgb(0,255,0)
 teal#008080rgb(0,128,128)
 aqua#00FFFFrgb(0,255,255)
 navy#000080rgb(0,0,128)
 blue#0000FFrgb(0,0,255)

 


See also

© 2006-2008 RapidTables.com