HTML Headings

HTML Tutorial

HTML Forms

HTML Graphics

HTML Media

HTML API

Html Headings

HTML headings are titles or subtitles that are displayed on a webpage.

HTML headings are <h1> to <h6> tags.

<h1>is used to define the most important heading. <h6> is used to define the least important heading.

Example

				
					<!DOCTYPE html>
<html>
<body>
<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>
</body>
</html>

				
			

Output:

html heading

Headings Are Important

Headings are used by search engines to index the structure and content of web pages.

Users use headings to skim a page as they display the document structure.

<h1> headings must be used for main headings, followed by <h2> headings, then the less important <h3>.

Bigger Headings

Every HTML has a default size.  By using the CSS font-size property, you can specify the size for any heading with the style attribute,

Example:

				
					<!DOCTYPE html>
<html>
<body>
<h1 style="font-size:30px;">Heading 1</h1>
<p>You can change the size of a heading with the style attribute, using the font-size property.</p>
</body>
</html>

				
			

Output:

Heading 1

You can change the size of a heading with the style attribute, using the font-size property.