HTML Body tag and elements
Body tags description
Please note most of the attributes in this section have been phased out in HTML 4 and although they will still work in modern browsers due to backward compatibility, it is better to control the body elements with CSS (Cascading Style Sheets) found in the later tutorials on this website.
As seen in the previous tutorials, the <body> and </body> tags are used to contain the main content of the webpage, but before we talk about the tags and elements that build up web page content you should know the Body tag has its own attributes.
Bgcolor
The attribute bgcolor is used for colouring the whole background of the webpage and it's syntax is as follows:
| <body bgcolor="red"> |
Or another colour which can be seen on this chart
Also the syntax can be displayed as:
| <body bgcolor="#FF0000"> |
The number "FF0000" (in this case pure red) represents a color from a hexadecimal chart RGB (Red, Green, Blue) of 64 million colors.
Background
The attribute background is used for replacing the background of the webpage with an image and it's syntax is as follows:
| <body background="picture.jpg"> |
Text
The attribute Text is used for replacing the text colour of the webpage with an alternative colour and it's syntax is as follows:
|
<body text="orange"> |
As with the "bgcolor" the syntax can be displayed as:
|
<body text="#FF9E00"> |
Synopsis
So now you have finished part one of the tutorials you should now understand:
- What is HTML
- How is HTML Constructed
- What is a Tag
- What is an Element
- What is an Attribute
- What is the <head> of a HTML page
- The basic Elements of the <head>
- What is the <Body> of a HTML page
If you have understood all this then its time to move on to the next tutorial which is how to format the contents of your HTML page and start to make real live websites.