Page 79 - TP_Pluse_V2.2_Class_6
P. 79
RULES FOR WRITING HTML5 CODES
There are certain rules for writing HTML 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 names 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. A HTML file is saved with .htm or .html extension.
Basic Structure of HTML Document is as follows:
<!DOCTYPE html>
<html>
<head>
<title>Title of the web page</title>
</head>
<body>
Content of the page
</body>
</html>
A HTML page is divided into two sections called Head and Body.
Head contains the information which is not to be shown on the web page.
Body contains the information which is to be shown on the web page.
HTML provides various tags such as <!DOCTYPE html>, <HTML>, <HEAD>, <TITLE>, <BODY>, and many
more. Let us discuss some tags in detail.
The <!DOCTYPE HTML> Tag
The <!DOCTYPE html> is not an element in HTML. It is a document type declaration that tells the
browser about the version of HTML. It is not case-sensitive which means you can write it in uppercase
or lowercase.
The <HTML> Tag
The <HTML> tag tells the web browser that the text contained between <HTML> and </HTML> is a web
page and can be viewed using a web browser. Every web page coding must start with the <HTML> tag
and end with the </HTML> tag.
The <HEAD> Tag
The <HEAD> tag defines header area of your web page. The information given in <HEAD> tag tells the
computer that this information is not to be shown on the web page. It is a container tag used in pair
as <HEAD> and </HEAD>. Every web page coding must have its header tag.
Introduction to HTML5 and CSS3 77

