heading

HTML Heading | Heading Elements

Spread the love

An HTML heading or HTML h tag is often outlined as a title or a subtitle that you just wish to show on the webpage. after you place the text at intervals the heading tags <h1>……..<h6>, it’s displayed on the browser in daring format, and also the size of the text depends on the amount of heading.

There are six totally different HTML headings that are outlined with the <h1> to <h6> tags, from highest level h1 (main heading) to the smallest amount level h6 (least necessary heading).

h1 is that the largest heading tag and h6 is that the smallest one. therefore h1 is employed for the foremost necessary heading and h6 is employed for the smallest amount necessary.

Example:-

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

Output:-

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

How to Use HTML Heading Tag?

Heading elements how to use?

Example:-

<!DOCTYPE html>
<html>
<head>
	<title>Heading elements</title>
</head>
<body>
<h1>h1 Main Heading</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<h2>h2 Second Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<h3>h3 Small Heading</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</body>
</html>

Output:-

h1 Main Heading

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

h2 Second Heading

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

h3 Small Heading

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


Notes:-

  • Heading info is often utilized by user agents to construct a table of contents for a document mechanically.
  • Avoid victimization heading parts to size text. Instead, use the CSS font-size property.
  • Avoid skipping heading levels: continuously begin from, <h1>, followed by <h2>then on.
  • Use only 1 <h1> per page or read. It ought to in short describe the general purpose of the content.
  • Using quite one won’t end in a blunder, however, isn’t thought of as a best observe. victimization only 1 <h1>is useful for screen reader users, and SEO.
  • While HTML5 permits a <h1>per sectioning part, it’s not thought of best observe and should subvert the expectations of however screen reader users navigate.


Spread the love

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *