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

sub ... ⁄sub

Share it

sub intro sub browser display sub parents - children sub syntax

HTML5 sub element

The sub element allows you to add a subscript. »video

About sub

Display & subport sub

Firefox iconChrome iconIE iconOpera iconSafari icon

Parents, children sub

Attributes sub


Do not use the sub element for presentation purpose: e.g. presentational purpose.
Use it only when a subscript is actually required: e.g. CO2 emissions.

Syntax sub

1<sub> ... </sub> »video

Attributes and Values sub (comma separated)

<subattribute="attribute_value(s)"> Video Examples
1. specific attributes
All Specific Attributes
2. global attributes
1.accesskey=keyboard key»img<sub accesskey="h"> ... </sub>
2.class=class name»html »img<sub class="class_name"> ... </sub>
3.contenteditable="",  , true, false »html<sub contenteditable="true"> ... </sub>
4.contextmenu=menu id value»html<sub contextmenu="menu_id_value"> ... </sub>
5.data-*= value -<sub data-http-error="404"> ... </sub>
6.dir=ltr, rtl, auto»html<sub dir="ltr"> ... </sub>
7.draggable= true,  , false»img<sub draggable="false"> ... </sub>
8.dropzone= copy, move, link, string:, file: -<sub dropzone="copy"> ... </sub>
9.hidden= "",  , hidden»html »img<sub hidden="hidden"> ... </sub>
10.id=id name»html »img<sub id="unique_id_name"> ... </sub>
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<sub lang="en"> ... </sub>
17.spellcheck="",  , true, false»html<sub spellcheck="true"> ... </sub>
18.style=CSS property:value»html »img<sub style="color:red"> ... </sub>
19.tabindex= integer »img<sub tabindex="3"> ... </sub>
20.title=text»html »link»style »abbr»dfn
»img »meter
<sub title="html page"> ... </sub>
21.translate="", yes, no»html »img<sub translate="yes"> ... </sub>
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 sub element

HTML5 sub element: mark up a subscript

min video details
00:00 video tutorial: sub element
00:04 sub element allows you to add a subscript
00:09 example next
00:24 2 from CO2 represents in this case a subscript

For more information about the sub element, please see the specs: W3CWHATWG