- HTML Tutorial
- HTML - Home
- HTML - History and Evolution
- HTML - Overview
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Headings
- HTML - Paragraphs
- HTML - Quotations
- HTML - Comments
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Style Sheet
- HTML - CSS Classes
- HTML - CSS IDs
- HTML - Images
- HTML - Image Map
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Iframes
- HTML - Blocks
- HTML Backgrounds
- HTML - Backgrounds
- HTML Colors
- HTML - Colors
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Code Builder
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <h1> to <h6> Tags
The HTML heading tags define six levels of heading, that is, <h1> to <h6>. where <h1> indicates the most important heading, and <h6> indicates the least important heading.
The heading tag also helps to give the title and subtitle at the top of the page or anywhere on the page. It is important to use the heading to show the document's structure.
<h1> headings should be used for main headings, followed by <h2> headings, then the less important <h3>, and so on.
Syntax
Following is the syntax of the heading tag <h1> to <h6> −
<!DOCTYPE html> <html> <body> <h1>…</h1> <h2>…</h2> <h3>…</h3> <h4>…</h4> <h5>…</h5> <h6>…</h6> </body> </html>
Example
In the following example, we are creating an HTML page that will show the important heading of the page, i.e., the <h1> and <h2> tags.
<!DOCTYPE html> <html> <body> <h1>This is heading 1</h1> <h2>This is heading 2</h2> <h1>Tutorialspoint</h1> </body> </html>
When we run the above code, it will generate an output consisting of the heading text that is written in h1 and h2 tags.
Example
Considering the following example, where we are going to create an HTML document using the the <h3> and <h4> tags.
<!DOCTYPE html> <html> <body> <h3>This is heading 3</h3> <h4>This is heading 4</h4> <h3>Tutorialspoint</h3> </body> </html>
On running the above code, the output window will pop up displaying the heading text of the h3 and h4 tags on the webpage.
Example
Let's look at the following example , We are going to create HTML documents using the h5 and h6 tags indicating that the heading of the page is least important.
<!DOCTYPE html> <html> <body> <h5>This is heading 5</h5> <h6>This is heading 6</h6> <p>The above heading is h5 and h6</p> </body> </html>
When we run the above code, it will generate an output consisting of the text displayed on the webpage.