Page 96 - TGPT_V5.0_C5_Flipbook
P. 96
Attribute
An attribute is a property that provides some additional information about a tag. It enhances
the functionality of a tag. It is always specified inside the opening tag. All attributes consist of
two parts—a name and a value.
The ‘name’ is the property that you want to set.
The ‘value’ is what you want for the respective property.
For example <hr width="50%">
The Width is the attribute of the <hr> tag which specifies the width of the horizontal line in
pixels or percentage. By default, the width is 100%.
Background Color
The background color is the colour that appears behind the text and other content on a
webpage. It makes a webpage look more attractive and easy to read.
In web design, the background color is set using CSS with the background-color property.
For example:
To set a light blue background color for a webpage, use:
RULES FOR WRITING HTML5 CODES
There are certain rules for writing HTML5 codes. Lets us learn more about them:
Container tags should always be closed properly.
Values given to the attributes should be enclosed within the double quotes.
Tag name should not contain spaces.
There should be no spaces between < and > in a tag.
Tags must be nested correctly.
HTML5 DOCUMENT STRUCTURE
An HTML document is a text file containing markup tags. The markup tags tell the Web browser
how to display the web page. An HTML file is saved with .htm or .html extension.
94 Premium Edition-V

