HTML Document
First HTML Example :
<!DOCTYPE html> <html> <body> <h1>This is Heading</h1> <p>This is Paragraph</p> </body> </html>
Explanation of Example :
Tag | Explanation |
---|---|
<!DOCTYPE html>
|
This will define HTML document |
<html> and </html> |
Text between html tag will describe the webpage |
<body> and </body> |
Text between the body tag is only visible content on the webpage |
<h1> and </h1> |
Text between the h1 tag displays Heading |
<p> and </p> |
Text between the p tag displays paragraph |
First Look at HTML Tag :
- Web Page Consists of HTML tags.
- HTML tag is basic building block of Web Page.
- HTML Tags are Keywords surrounded with starting angular bracket and closing angular bracket
- Generally each Tag comes in a pair except some non closing tags.
- Starting Tag is also known as “Opening Tag“.
- Ending Tag is also known as “Closing Tag“.
Structure of HTML Document :
HTML Elements can be nested :
HTML tags can be nested. One HTML Element can have other HTML elements inside it. e.g -
<body> <h1><b>This is a Heading</b></h1> <b>Text is bold</b> </body>
in the above HTML markup, We have nested the HTML elements.
HTML Documents are Case-Insensitive :
We can write HTML code in either cases i.e in Uppercase or in lowercase.
<h1><b>This is a Heading</b></h1>
and
<H1><b>This is a Heading</B></h1>
both of the above lines will print same result.