HTML h1,h2,h3,h4,h5,h6 tags

This article will give an example about the general HTML tags.

Example HTML h1 to h6 tags -The six different HTML headings:

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

HTML h1,h2,h3,h4,h5,h6 tags

Definition and Usage
The <h1> to <h6> tags are used to define HTML headings.
<h1> defines the largest heading and <h6> defines the smallest heading.

Browser Support

The <h1> to <h6> tags are supported in all major browsers. Only in a text browsers you may not see them or are displayed in another way.

HTML h1,h2,h3,h4,h5,h6 tags

Differences Between HTML and XHTML
The \"align\" attribute of the <h1> to <h6> elements was deprecated in HTML 4.01, and is not supported in XHTML 1.0 Strict DTD.
Deprecated

A deprecated element or attribute is one that has been outdated.

Deprecated elements may become obsolete in the future, but browsers should continue to support deprecated elements for backward compatibility.
Obsolete

Obsolete elements and attributes have no guarantee of browser-support and they are no longer defined in the W3C specification.

<b>Optional Attributes</b>
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.





Untitled Document

Attribute Value Description DTD
align left
center
right
justify
Deprecated. Use styles instead.
Specifies the alignment of
a heading
TF



Standard Attributes

The <h1> to <h6> tags support the following standard attributes, supported by all HTML and XHTML tags, with a few exceptions.





Untitled Document

Attribute Value Description DTD
class classname Specifies a classname for an element STF
dir rtl
ltr
Specifies the text direction
for the content in an element
STF
id id Specifies a unique id for an element STF
lang language_code Specifies a language code for the content in an element STF
style style_definition Specifies an inline style for an element STF
title text Specifies extra information about an element STF
xml:lang language_code Specifies a language code for the content in an element, in
XHTML documents
STF



Event Attributes
HTML 4 added the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element.

Below is the standard event attributes that the <h1> to <h6> tags support and can be inserted into HTML / XHTML elements to define event actions.





Untitled Document

Attribute Value Description DTD
onclick script Script to be run on a mouse click STF
ondblclick script Script to be run on a mouse double-click STF
onmousedown script Script to be run when mouse button is pressed STF
onmousemove script Script to be run when mouse pointer moves STF
onmouseout script Script to be run when mouse pointer moves out of an
element
STF
onmouseover script Script to be run when mouse pointer moves over an
element
STF
onmouseup script Script to be run when mouse button is released STF
onkeydown script Script to be run when a key is pressed STF
onkeypress script Script to be run when a key is pressed and released STF
onkeyup script Script to be run when a key is released STF



Tags

Filed Under: HTML

Anthony Gee About the Author: Anthony G. is an IT specialist with more than 9 years of solid working experience in the Web Hosting industry. Currently works as server support administrator, involved in consultative discussions about Web Hosting and server administration. One of the first writers in the Onlinehowto.net website, now writing for Free Tutorials community - he is publishing tutorials and articles for the wide public, as well as specific technical solutions.

Comments (2)

  1. RipperReport says:

    This is just ripped from http://www.w3schools.com/TAGS/tag_hn.asp
    You aven’t even bothered to make the tables yourself, you just took screenshots of them.

  2. Tonny says:

    This is all what can be said about that. There was a link used in another tutorial, to the description which was reported several times as broken/changed. Finally we repeated the information.

Leave a Reply