HTML Headings

|  | Search W3Schools : |

HOME | HTML | CSS | XML | JAVASCRIPT | ASP | PHP | SQL | MORE... |  | References | Examples | Forum | About

ADVERTISEMENTS XML Certification Download XML editor Custom Programming |  |

Table of contents

HTML Basic
HTML HOME
HTML Introduction
HTML Get Started
HTML Basic
HTML Headings
HTML Paragraphs
HTML Formatting
HTML Elements
HTML Attributes
HTML Styles
HTML Links
HTML Images
HTML Tables
HTML Lists
HTML Forms
HTML Colors
HTML Colornames
HTML Colorvalues
HTML Quick List
HTML Advanced
HTML Layout
HTML Frames
HTML Fonts
HTML 4.0 Why
HTML CSS
HTML Entities
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML Attributes
HTML Events
HTML URL Encode
HTML Webserver
HTML Summary
Examples/Quiz
HTML Examples
HTML Quiz
HTML Exam
References
HTML Tag List
HTML Attributes
HTML Events
HTML Colornames
HTML Character Sets
HTML ASCII
HTML ISO-8859-1
HTML Symbols
HTML URL Encode
HTML Lang Codes
HTTP Messages

Selected Reading

Web Statistics
Web Glossary
Web Hosting
Web Quality
W3Schools Tutorials
W3Schools Forum
Helping W3Schools

# HTML Headings

Headings are important in HTML documents.

## HTML Headings

Headings are defined with the <h1> to <h6> tags.

<h1> defines the largest heading. <h6> defines the smallest heading.

    <h1>This is a heading</h1>
    <h2>This is a heading</h2>
    <h3>This is a heading</h3>

Try it yourself

Note: Browsers automatically adds an empty line before and after headings.

## Headings Are Important

Use the HTML heading tags for headings only. Don't use headings to make something BIG or bold.

Search engines use your headings to index the structure and content of your web pages.

Since users may skim your pages by its headings, it is important to use headings to show the document structure.

H1 headings should be used as main headings, followed by H2 headings, and less important H3 headings, and so on.

## HTML Comments

Comments can be inserted in the HTML code to make it more readable and understandable. Comments are ignored by the browser and not displayed.

Comments are written like this:

    <!-- This is a comment -->

Try it yourself

Note: There is an exclamation point after the opening bracket, but not before the closing bracket.

## HTML Tip - How to View HTML Source

Have you ever seen a Web page and wondered "Hey! How did they do that?"

To find out, click the VIEW option in your browser's toolbar and select SOURCE or PAGE SOURCE. This will open a window that shows you the HTML code of the page.

## Examples From This Page

Headings
This example demonstrates the tags that display headings in an HTML document.

Hidden comments
This example demonstrates how to insert a hidden comment in the HTML source code.

## HTML Tag Reference

When you lookup W3Schools' tag reference, you will see additional information about tags and their attributes.

You will learn more about HTML tag attributes in the next chapters of this tutorial.

Tag | Description
--- | ---
<html> | Defines an HTML document
<body> | Defines the document's body
<h1> to <h6> | Defines header 1 to header 6
<!--> | Defines a comment

## Altova® XMLSpy® - The world's best-selling XML editor!

Whether you're new to XML or already an advanced user, the user-friendly views and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to meet your XML and Web services development needs from start to finish.

- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!

Download a fully functional free 30-day trial today!

WEB HOSTING
ASP.NET Shopping Cart
$15 Domain Name Registration Save $20 / year!
Buy UK Domain Names Register Domain Names
Cheap Domain Names Cheap Web Hosting
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting

WEB BUILDING
Website Templates Flash Templates Website Builder Internet Business Opportunity
Custom Programming
FREE Trial or Demo Web Content Manager Forms,Web Alerts,RSS
Download XML editor
FREE Flash Website
FREE Web Templates

EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification

HOME or Top of Page |  | Printer Friendly
W3Schools is for training only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy. Copyright 1999-2009 by Refsnes Data. All Rights Reserved.