HTML5 Attributes can be used on any element. HTML elements may contain attributes that are used to set various properties of an element.All attributes have its a name and a value.
HTML5 attributes are case insensitive.
The below attributes are supported by almost all the HTML 5 tags.
- accesskey - It helps in specifying a keyboard shortcut for accessing an element.
- align - It horizontally aligns the tags at right, left, center side.
- valign - It specifies vertically aligns like top, middle, bottom tags within an HTML element.
- class - It classifies an element for use with Cascading Style Sheets.
- background - It places an background image behind an element.
- draggable - It specifies if the user is allowed to drag an element or not.
- bgcolor - It places a background color behind an element.
- id - It defines unique id for an element.
- style - It specifies an inline style for an element.
- lang - It specifies language of the element's content.
- height - It specifies the height of tables, images, or table cells, div etc.
- width - It specifies the width of tables, images, or table cells, div etc.
- title - It specifies extra information about an element.
- hidden - It specifies whether element should be visible or not.
- tabindex - It specifies the tab order of an element.
- itemprop - It is used to group items.
- translate - It specifies content of an element should be translated or not.
- itemtype- It specifies item types of the item.
HTML5 Example :
<section class = "main">...</section>
Look at above <section> element. This <section> element has class attribute. This class attribute has value as main. main is class name of css.
Comments