Standard Attributes of HTML5.


Attributes in HTML5

    • Elements in HTML5 have the attributes.
    • Attributes are used to set the various properties of the element.
    • They provide the additional information to the element.
    • They are specified in tag(‘start tag’).
    • Attributes mostly come in pairs .example like name=’value’.
    • Attributes in HTML5 are case insensitive they can be written in all uppercase or mixed case.

Some Standard Attributes are:
The listed attributes below are mostly supported by almost all the HTML 5 tags.

Attribute Options Function
accesskey User Defined Its a keyboard shortcut to access an element
align right, left,center Aligns tags horizontally
background URL Used to Places an background image behind an element
bgcolor numeric, hexidecimal, RGB values Used to Placesa background color behind an element
class User Defined Used to classified an element for use with Cascading Style Sheets.
contenteditable true, false Used to specify if the user can edit the element’s content or not.
contextmenu Menu id Used to specify the context menu for an element.
data-XXXX User Defined Custom attributes. Authors of a HTML document can define their own attributes. Must start with “data-“.
draggable true,false, auto Used to specify whether or not a user is allowed to drag an element.
height Numeric Value Used to specify the height of tables, images, or table cells.
hidden hidden Used to specify whether element should be visible or not.
id User Defined Names an element for use with Cascading Style Sheets.
item List of elements Used to group elements.
itemprop List of items Used to group items.
spellcheck true, false Used to specify if the element must have it’s spelling or grammar checked.
style CSS Style sheet Used to specify an inline style for an element.
subject User define id Used to specify the element’s corresponding item.
tabindex Tab number Used to specify the tab order of an element.
title User Defined “Pop-up” title for your elements.
valign top, middle, bottom Used to aligns tags vertically within an HTML element.
width Numeric Value Used to aligns tags the width of tables, images, or table cells.

In HTML5 a new feature being introduced Custom Attributes:
This is a new feature in HTML5 .
It starts with data- and named it based on your requirement.

<div class="xyz" data-subject="xyz" data-level="complex">

Categories: Designs, Html, Main

Leave A Comment