The most important tags in HTML are tags that define headings, paragraphs and line breaks.
Headings :-
Headings are defined with the <h1> to <h6> tags. <h1> defines the largest heading. <h6> defines the smallest heading.
<h1>This is my heading</h1>
<h2>This is my heading</h2>
<h3>This is my heading</h3>
<h4>This is my heading</h4>
<h5>This is my heading</h5>
<h6>This is my heading</h6>
Output :-
This is my heading
This is my heading
This is my heading
This is my heading
This is my heading
This is my heading
HTML automatically adds an extra blank line before and after a heading.
Paragraphs :-
Paragraphs are defined with the <p> tag.
<p>This is first paragraph</p>
<p>This is second paragraph</p>
Output :-
This is first paragraph
This is second paragraph
Line Breaks :-
The <br> tag is used when you want to move from one line to another, but don't want to start a new paragraph. The <br> tag forces a line break wherever you place it.
<p>This <br> is a my<br>paraghaph with line break</p>
Output :-
This
is a my
paraghaph with line break
The <br> tag is an empty tag. It has no closing tag.
Comments in HTML :-
The comment tag is used to insert a comment in the HTML source code. A comment will not be considered by the browser. You can use comments to explain the code, which can help you when you edit the source code in future.
<!-- This is my html comment -->
Note that you need an exclamation point after the opening bracket, but not before the closing bracket.
Basic HTML Tags :-
| Tag |
Description |
| <html> |
This tag defines an HTML document |
| <body> |
This tag defines the body of html document |
| <h1> to <h6> |
This tag defines heading 1 to heading 6 |
| <p> |
This tag defines a paragraph |
| <br> |
This tag inserts a single line break |
| <b> |
This tag defines a bold text |
| <!--> |
This tag defines a comment |