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

HTML Headings

« Previous Next Chapter »

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.

Example

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

Try it yourself »

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


Headings Are Important

Use HTML headings for headings only. Don't use headings to make text 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, then less important H3 headings, and so on.


HTML Rules (Lines)

The <hr /> tag is used to create an horizontal rule (line).

Example

<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>

Try it yourself »


HTML Comments

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

Comments are written like this:

Example

<!-- 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

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.

Horizontal rule
This example demonstrates how to insert a horizontal rule.


HTML Tag Reference

W3Schools' tag reference contains additional information about these tags and their attributes.

You will learn more about HTML tags and 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
<hr /> Defines a horizontal rule
<!--> Defines a comment

« Previous Next Chapter »


1,050,724 Sites built with Wix. Make your own!

Click here to design a Stunning Flash Website for Free

Wix is a revolutionary web design tool that provides anyone with the possibility to create professional and beautiful websites for free.

With e-commerce features, search engine visibility and many more professional tools, Wix is the ultimate solution for creating a spectacular site while saving tons of money.



FUNC Travel
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting
Top Web Hosting
Windows Hosting
WEB BUILDING
Download XML Editor
FREE Flash Website
FREE Web Templates
FLIGHT TICKETS
Find the cheapest flight
to any destination now!
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification
STATISTICS
Browser Statistics
Browser OS
Browser Display