Page 61 - CA_165_V2.0_Flipbook
P. 61
<TAGNAME ATTRIBUTE_NAME="ATTRIBUTE_VALUE"> Content </TAGNAME>
Thus, HTML tag consists of a tag name, followed by an optional list of attributes, all inside the opening
and closing angular brackets('<' and '>') of an opening tag.
Attributes used in the <BODY> Tag
In <BODY> tag, the following eight attributes can be used:
BGCOLOR TEXT
BACKGROUND LINK
ALINK VLINK
LEFTMARGIN TOPMARGIN
BGCOLOR Attribute
This attribute of <BODY> tag is used to set the background colour of the displayed screen. By default, the
background colour of the web browser is white.
Different colours can be obtained on the display screen by the combination of three basic colours namely,
red, green and blue. In HTML, each of these colours has a defined degree code that ranges from 00 (Nil)
to FF (Full) in hexadecimal form. The colour string is obtained by the combination of the code of each
colour i.e., red, green and blue, preceded by the symbol #. The syntax for using the BGCOLOR attribute
with the <BODY> tag is as follows:
<BODY BGCOLOR = "COLOR NAME" or "#RRGGBB"> </BODY>
Where ‘RR’ represents the hexadecimal value of red, ‘GG’ represents the hexadecimal value of green and
‘BB’ represents the hexadecimal value of blue.
Notes
The BGCOLOR attribute is not supported in HTML5.
COLOR CODING
Coding of colour can be done as a combination of Red(RR), Green (GG) and Blue (BB) colour. These coding
are represented in ordered sequences of RR, GG and BB. For example: If we select a colour as Red, then
its red value is full, green value is 00 (i.e. Nil) and blue is also 00 (Nil).
Red=FF(Full) Green=00 (Nil) Blue=00 (Nil)
The resulting colour is red, so the red colour has the string (value) "#Ff0000".
<BODY BGCOLOR =“#FF0000 ”>
RR (Red) = FF (Full)
GG (Green) = 00 (Empty)
BB (Blue) = 00 (Empty)
Introduction to HTML 59

