Web Hosts
with
Website Builders
Hosting trusted by almost 4 million sites!

Click to TRY FREE

Get a Website in Minutes at Web.com

HTML Code Tutorial

Tutor Ebook Download

Color in HTML Pages

When color is used properly on anHTML page, it can enhance the appearance and even the usability of that page. Too much color detracts from its effectiveness as a tool.

Color can be applied to many elements of HTML. Fonts, horizontal lines, borders and backgrounds in the body and tables and other box type elements can all use the color attribute.

If not specified the default color for text lines and borders is black. The default background color is white. There are also default colors for the different states of hyperlinks.

Methods

Color can be set using different methods.

It can be set by color name.
bgcolor="red" and p{color : red } are both acceptable methods of using the color name method.

Color can also be set using RGB or Hexidecimal code.
bgcolor="#ff0000"
p {color : ff0000}
p {color : #ff0000}
p {color : ff0} and
p {color : #ff0} are also acceptable methods of assigning color.

Example:
<p STYLE="color : ade;background-color :000">Hello world</p>
produces:

Hello world

Color and Browsers

It should be noted that the final word on how color displays in a browser is determined by the user's browser and the type of hardware on the viewers PC.

It was thought at one time that there were 216 colors that would display the same from browser to browser. Recent studies have shown that there are only about 11 colors that will appear the same under all circumstances involved in the viewing process.

Check our hexidecimal color code chart for standard and non standard web palette colors.

Color and CSS

There is one basic rule that you must follow when applying color, to make your style sheets compliant with CSS protocol.
If you define a foreground color, you should also define a background color for the element.

Example:
p{font-family: Arial;......; color :#0F0F0F;background-color :#FFFFFF }

Take a quiz. Take a Quiz on this Information.

Check out our Free Frames Template Kit or try our Free Frames Kit Demo




CGI Online
How to Create a Website -Tutorial
Create a Website - Home


This Free HTML Tutorial
is provided by Net Success 2000 Plus Inc.
PO Box 1508
Somerset, KY 42502
Last Modified: September 10, 2007

HTML Codes Tutor Ebook