W3-Video WEB Tutorials

w3-video.com is a Free eLearning Website with over 500 video tutorials on HTML5, XAMPP, .htaccess, Firefox, Notepad++

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++


h1 h2 h3 h4 h5 h6


Share it

h1...h6 intro h1...h6 browser display h1...h6 parents - children h1...h6 outlineh1...h6 syntax

HTML5 h1, h2, h3, h4, h5, h6 elements

The h1, h2, h3, h4, h5, h6 elements allows you to add headings to your document: »video

About h1, h2, h3, h4, h5, h6 elements

Display & support h1, h2, h3, h4, h5, h6 elements

Firefox iconChrome iconIE iconOpera icon*Safari icon

* Operav12.02 display not ok for h1 → h6 elements nested inside elements part of sectioning content

Parents, children h1, h2, h3, h4, h5, h6 elements

Attributes h1, h2, h3, h4, h5, h6

Warning

h1 → h6 elements, contribute to document outline: presented - (HTML4 old way)example, (HTML5 new way)example »video

Syntax h1, h2, h3, h4, h5, h6

1
2
3
4
5
6
<h1> ... </h1>
<h2> ... </h2>
<h3> ... </h3>
<h4> ... </h4>
<h5> ... </h5>
<h6> ... </h6> »video

Attributes and Values h1, h2, h3, h4, h5, h6 (comma separated)

<h1...h6attribute="attribute_value(s)"> Video Examples
1. specific attributes
All Specific Attributes
2. global attributes
1.accesskey=keyboard key»img<h3 accesskey="h"> ... </h3>
2.class=class name»html »img<h3 class="class_name"> ... </h3>
3.contenteditable="",  , true, false »html<h3 contenteditable="true"> ... </h3>
4.contextmenu=menu id value»html<h3 contextmenu="menu_id_value"> ... </h3>
5.data-*= value -<h3 data-http-error="404"> ... </h3>
6.dir=ltr, rtl, auto»html<h3 dir="ltr"> ... </h3>
7.draggable= true,  , false»img<h3 draggable="false"> ... </h3>
8.dropzone= copy, move, link, string:, file: -<h3 dropzone="copy"> ... </h3>
9.hidden= "",  , hidden»html »img<h3 hidden="hidden"> ... </h3>
10.id=id name»html »img<h3 id="unique_id_name"> ... </h3>
11.itemid= URL --
12.itemprop= string »link »a-
13.itemref= string --
14.itemscope= "",  , itemscope--
15.itemtype= absolute URL --
16.lang=language code »html »head»title »img<h3 lang="en"> ... </h3>
17.spellcheck="",  , true, false»html<h3 spellcheck="true"> ... </h3>
18.style=CSS property:value»html »img<h3 style="color:red"> ... </h3>
19.tabindex= integer »img<h3 tabindex="3"> ... </h3>
20.title=text»html »link»style »abbr»dfn
»img »meter
<h3 title="html page"> ... </h3>
21.translate="", yes, no»html »img<h3 translate="yes"> ... </h3>
All Global Attributes
3. global event attributes
1.onclick=script» list<element onclick="script" > ...
2.ondblclick=script» list<element ondblclick="script" > ...
All Event Attributes

Video demonstration h1, h2, h3, h4, h5, h6 elements

HTML5 adding all headings in page

min video details
00:04 video tutorial: adding headings in page
00:12 saying you have the next headings you want to add into your HTML document
00:17 this is the main heading, so its rank should be 1 → h1
00:22 this heading is right under the main heading, so its rank should be 2 → h2
00:28 the next 3 headings can be placed on the same level but under h2, so their rank will be 3 → h3
00:38 "day one Sistine Chapel", is a heading under h3 → its rank will be 4 → h4
00:44 this heading is under h4 → its rank will be 5 → h5
00:47 this heading is under h5 → its rank will be 6 → h6
00:51 the rank of each heading has been decided, now we can add them (the headings) in page, using the tags: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
02:10 the biggest heading is h1 while the smallest is h6
02:18 for example purpose: adding paragraphs e.g. a page with headings and paragraphs
02:43 you can add explicit sections in order to better structure your content: HTML5 way
02:50 in order to maintain the same semantic, 'Rome' heading will be nested inside a section
02:57 'Colosseum', 'Pantheon', 'Sistine Chapel' will be nested inside a section INSIDE 'Rome's section
02:59 'day one Sistine Chapel' heading will be nested inside a section INSIDE Sistine Chapel's section
03:03 and so on..we will continue to nest headings in sections INSIDE sections until we reach the corresponding rank for that heading
03:10 Example: nesting h2 (+ other tags) inside section element
03:23 nesting h3 (+ all other tags) inside section element INSIDE h2's section
03:39 nesting h4 (+ all other tags) inside section element INSIDE h3's section
03:57 nesting h5 (+ all other tags) inside section element INSIDE h4's section
04:14 nesting h6 inside section element INSIDE h5's section
04:27 the display and the semantic have been maintained
04:40 in order to avoid confusion: if you do not realize the appropriate heading rank for that nested section, better use h1 inside all nested sections like this:
05:16 the display and the semantic have been maintained in this case too
05:25 h1's and sections nested inside other sections in order to target the corresponding rank for our headings

For more information about the h1 h2 h3 h4 h5 h6 elements, please see the specs: W3CWHATWG