Thursday, November 21, 2013

Body Background Color Code >>html, head, body

Posted by Bit Version

How to set the background color in html?


First let us know what we call as attributes.
If human body is tag, its color can be called its attribute.
Similarly each tag can have its own set of attributes.

Now we will see about the attributes of body tag.
The most used one is "bgcolor". It is used to set the background color.
<body bgcolor="red">

SO we add the attribute in the opening tag.
There we give the attribute and equate it to the value we want.
"bgcolor="green"". You can set any value as red, blue, orange, yellow, etc......

e.g: Combining all the tags learned so far
<title> My Page

<body bgcolor="green">
This is my first page </body>

Test It: Copy the code or type the code in to the text box shown below and click show.


Post a Comment