Lesson 9:HTML-bgcolor

The bgcolor attribute control the background color of the page. Bgcolor can be used with several html tags but here our keen focus on <body> background color. The value of background attribute can be set in plain text or in hexadecimal numbers, all background colors are the mix of RGB(red,green,blue) colors. Each colors value can be set between 0 to 255, in hexadecimal it is represented as 00 to FF.

Maximum value of RGB background color in hexadecimal is FFFFFF which is white color and lowest value is 000000 which is black background color.

Below see the figure for some of background colors is represented in hexadecimal.

image

if you found this thing irritating then don’ worry there is another way out, it’s possible to define the color with name rather then hexadecimal number.

Now let me show you some of the examples of bgcolor attribute to clear your understanding.

HTML Code:

<html>
<head>
<title>
Headings
</title>
</head>
<body bgcolor=”#FFAA00″>
<h1>Check the Background Color</h1>
</body>
</html>

Output of HTML Code:

image

HTML Code:

<html>
<head>
<title>
Headings
</title>
</head>
<body bgcolor=”blue”>
<h1>Check the Background Color</h1>
</body>
</html>

Output of HTML Code:

image

Be Sociable, Share!

Leave a Reply