Learn Basic HTML Complete Course part 27

1 min read

Global Attributes


HTML global attributes are those attributes which are common for all HTML elements. The global attributes are supported by both standard and non-standard element.

The global attributes can be used with all elements, although it may not have any effect on some elements.

Following is the complete list of global attributes with their description:


AttributesvalueDescription
accesskeycharacterIt is used to generate keyboard shortcuts for the current element.
classclassnameIt is used to provide the class name for the current element. It is mainly used with the stylesheet.
Contenteditabletrue
false
It determines whether the content within an element is editable or not.
contextmenumenu_idIt defines the id for the <menu> element which is used as a context menu (a menu appear on right click) for an element.
data-*somevalueIt is used to store element-specific private data which can be accessed by Javascript.
dirrtl
ltr
auto
It specifies the direction of the content inside the current element.
draggabletrue
false
auto
It specifies whether the content within an element is movable or not using Drag and Drop API.
dropzonecopy
move
link
It specifies the action is taken on the dragged element when it is dropped, ¬¬ such as whether it is copied, moved or linked.
hiddenIt is used to hide the element from view.
ididIt specifies a unique id for the element. It can be used with CSS and JavaScript.
langlanguage_codeIt specifies the primary language for the content of an element.
stylestyleIt is used to apply inline CSS to the current element.
spellchecktrue
false
It specifies whether the content should be checked for spelling errors or not.
tabindexnumberIt determines the tabbing order of an element.
titletextIt is used to provide the title, name, or some extra information about the element.
translateyes
no
It specifies whether the content of the element should be translated when the page is localized or not.

You may like these posts

  • HTML CharsetHTML Charset is also called HTML Character Sets or HTML Encoding. It is used to display an HTML page properly and correctly because for displaying anything correctly, a…
  • HTML LayoutsHTML layouts provide a way to arrange web pages in well-mannered, well-structured, and in responsive form or we can say that HTML layout specifies a way in which the we…
  •  HTML EntitiesHTML character entities are used as a replacement of reserved characters in HTML. You can also replace characters that are not present on your keyboard by entiti…
  • HTML Formatting TagsHTML Formatting is a process of formatting text for better look and feel. HTML provides us ability to format text without using CSS. There are many formatt…
  • HTML ElementsAn HTML file is made of elements. These elements are responsible for creating web pages and define content in that webpage. An element in HTML usually consist of a sta…
  • HTML ClassesClass Attribute in HTMLThe HTML class attribute is used to specify a single or multiple class names for an HTML element. The class name can be used by CSS and JavaScrip…

Post a Comment