HTML Headings
Headings
In HTML headings play vital role because they are used to describe topic headings. There are six types of headings in HTML.
Syntax
- <h1> Content </h1>
- <h2> Content </h2>
- <h3> Content </h3>
- <h4> Content </h4>
- <h5> Content </h5>
- <h6> Content </h6>
Note:
Headings are pair tags or non empty elements and h
is short form of heading and 1, 2, 3, 4, 5, 6 indicates number of heading.
Example
This is heading 1
This is heading 2
This is heading 3
This is heading 4
This is heading 5
This is heading 6
The content inside headings appears bold and large and some how different from other tags.
Note:
<h1> tag is the largest and the most important tag in HTML. <h6> tag is the smallest and less important tag in HTML.
Practice Task
Open notepad or any other text editor, follow the following points.
- Write all six headings with different content (data).
- The content (data) of heading 1 should be
I am the largest and important
- The content (data) of heading 2 should be
I am smaller than heading 1
- The content (data) of heading 3 should be
I am smaller than heading 2
- The content (data) of heading 4 should be
I am smaller than heading 3
- The content (data) of heading 5 should be
I am smaller than heading 4
- The content (data) of heading 6 should be
I am the smallest and less important
- Use
<br />
element for next or new line if neccessary otherwise leave this point.
save file with name task.html or task.htm and then open it using any browser and see results.
Solution
I am the largest and important
I am smaller than heading 1
I am smaller than heading 2
I am smaller than heading 3
I am smaller than heading 4
I am the smallest and less important
HTML Code Generators
Try our HTML generators to practice and generate HTML code in real time.