HTML5 Attributes

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.

  1. accesskey - It helps in specifying a keyboard shortcut for accessing an element.
  2. align - It horizontally aligns the tags at right, left, center side.
  3. valign - It specifies vertically aligns like top, middle, bottom tags within an HTML element.
  4. class - It classifies an element for use with Cascading Style Sheets.
  5. background - It places an background image behind an element.
  6. draggable - It specifies if the user is allowed to drag an element or not.
  7. bgcolor - It places a background color behind an element.
  8. id - It defines unique id for an element.
  9. style - It specifies an inline style for an element.
  10. lang - It specifies language of the element's content.
  11. height - It specifies the height of tables, images, or table cells, div etc.
  12. width - It specifies the width of tables, images, or table cells, div etc.
  13. title - It specifies extra information about an element.
  14. hidden - It specifies whether element should be visible or not.
  15. tabindex - It specifies the tab order of an element.
  16. itemprop - It is used to group items.
  17. translate - It specifies content of an element should be translated or not.
  18. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

90735