Background colour

The BODY tag has other parameter or attributes, so I think it would nice if we explore how to add background color for body of web page by extending the <BODY> tag.

<BODY BGCOLOR="green">

Example below:

<HTML>
<HEAD>
<TITLE> Website title here </TITLE>
</HEAD>
<BODY BGCOLOR="green">
Website content here
</BODY>
</HTML>


The green background preview

Adding a color using the name such as “green” in the BGCOLOR parameter of the BODY tag might be easy but it is not considered a standard as some browser may not understand It or If you type a colour name such as “LIGHT BLUE” therefore the “hexadecimal” number standard is more recognized therefore enabling you be able to produce 16 million colors for your web design. Let’s see an example below.

<HTML>
<HEAD>
<TITLE> Website title here </TITLE>
</HEAD>
<BODY BGCOLOR="#00FF00">
Website content here
</BODY>
</HTML>

The light-blue background preview

Format of color number is RRGGBB. Each color is a combination of three main colors: Red, Green and Blue (a popular computer color generation standard). In color format RR is value of red component of the main color in hexadecimal format. GG is value of green component and BB is the value of blue component.
Two digit hexadecimal number can be anything between 00 to FF i.e. 0 to 255 in decimal format.

So if we write 00FF00 we mean (red=0, green=255, blue=0) so the result is a pure green color. See www.w3c.org for more

 

Next »


Creating webpage with HTML »

META Data »

Background colour »

HTML Versions »

Setting up a website »

Break Line, paragraph and alignment »

Special character, bold, italics, underline and marquee »

Text Formatting »

Listing items and Horizontal rule »

Images »

Tables »

Hyperlink »

Form »