HTMLforall

  HTML | PHP | Forum

HTML <h1 ... h6> tags

Syntax

<h1> - </h1>
<h2> - </h2>
<h3> - </h3>
<h4> - </h4>
<h5> - </h5>
<h6> - </h6>

Definition and Usage

A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.

There are six levels of headings in HTML with H1 as the most important and H6 as the least. Visual browsers usually render more important headings in larger fonts than less important ones.

A document generally should have exactly one H1 element to mark the most important heading.

Optional Attributes

Attribute Value Description
align left
center
right
justify
Specify the alignment of the text in the header. Deprecated. Use styles instead

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.

Example

Source Output
<h1> title with h1 tag </h1>
<h2> title with h2 tag </h2>
<h3> title with h3 tag </h3>
<h4> title with h4 tag </h4>
<h5> title with h5 tag </h5>
<h6> title with h6 tag </h6>

title with h1 tag

title with h2 tag

title with h3 tag

title with h4 tag

title with h5 tag
title with h6 tag

Home

Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

Top-Level Elements
<!--...-->
<!DOCTYPE> 
<html>
<head>
<body>
<frameset>
Head Elements
<base>
<isindex>
<link>
<meta>
<script>
<style>
<title>
Generic Block-level Elements
<address>
<blockquote>
<center>
<del>
<div>
<h1> to <h6>
<hr>
<ins>
<isindex>
<noscript>
<p>
<pre>
Lists
<dd>
<dir>
<dl>
<dt>
<li>
<menu>
<ol>
<ul>
Tables
<caption>
<col>
<colgroup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<tr>
Forms
<button>
<fieldset>
<form>
<input>
<label>
<legend>
<option>
<optgroup>
<select>
<textarea>
Special Inline Elements
<a>
<applet>
<area>
<basefont>
<bdo>
<br>
<font>
<iframe>
<img>
<map>
<object>
<param>
<q>
<script>
<span>
<sub>
<sup>
Phrase Elements
<abbr>
<acronym>
<cite>
<code>
<del>
<dfn>
<em>
<ins>
<kbd>
<samp>
<strong>
<var>
Font Style Elements
<b>
<big>
<i>
<s>
<small>
<strike>
<tt>
<u>
Frames
<frame>
<frameset>
<noframes>

 

Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us