HTML Tags Part – 1

Heading tags

Headings are defined with the <h1> to <h6> tags. <h1> defines the largest heading while <h6> defines the smallest. HTML automatically adds an extra blank line before and after a heading.

For example:

<h1>This is Heading 1</h1>
<h2>This is Heading 2</h2>
<h3>This is Heading 3</h3>
<h4>This is Heading 4</h4>
<h5>This is Heading 5</h5>
<h6>This is Heading 6</h6>

Paragraph tag

Paragraphs are defined with the <p> tag. It is a block of text. You can use the align attribute with a paragraph tag.

<p align="left">This is a paragraph</p>
<p align="center">this is another paragraph</p>

The align attribute specifies the alignment of paragraph.

Line Break

To start a new line, <br> tag is used. The <br> tag forces a line break wherever you place it. It is similar to single spacing in a document.

<p>This <br> is a para<br> graph with line breaks</p>

The <br> tag has no closing tag.

Horizontal Rule

The <hr> element is used for horizontal rules that act as dividers between sections.

The horizontal rule does not have a closing tag.

Download as PDF

« Back to Course page