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.
The attribute bgcolor is used for colouring the whole background of the webpage and it's syntax is as follows:
Also the syntax can be displayed as:
The number "FF0000" (in this case pure red) represents a color from a hexadecimal chart RGB (Red, Green, Blue) of 64 million colors.
The attribute background is used for replacing the background of the webpage with an image and it's syntax is as follows:
The attribute Text is used for replacing the text colour of the webpage with an alternative colour and it's syntax is as follows:
As with the "bgcolor" the syntax can be displayed as:
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.