- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML - Attribute Reference
There are few HTML attributes which are standard and associated to all the HTML tags. These attributes are listed here with a brief description.
Global Attributes
Not valid in base, head, html, meta, param, script, style, and title elements.
Attribute | HTML-5 | Description |
---|---|---|
accesskey | Specifies a shortcut key for an element to be used in place of keyboard. | |
class | The class of the element | |
contenteditable | Yes | Boolean attribute to specify whether the element is editable or not. |
contextmenu | Yes | Specifies a context menu for an element. |
data-* | Yes | Used to store custom data associated with the element. |
draggable | Yes | Boolean attribute to specify whether the element can be dragged or not. |
dropzone | Yes | Specifies whether the dragged data is copied, moved, or linked, when dropped. |
hidden | Yes | Specifies whether element should be visible or not. |
id | A unique id for the element | |
spellcheck | Yes | Specifies if the element must have it's spelling or grammar checked. |
style | An inline style definition | |
tabindex | Specifies the tab order of an element. | |
title | A text to display in a tool tip | |
translate | Yes | Boolean attribute specifies whether the content of an element should be translated or not |
Language Attributes
The lang attribute indicates the language being used for the enclosed content. The language is identified using the ISO standard language abbreviations, such as fr for French, en for English, and so on.
RFC 1766 (http://www.ietf.org/rfc/rfc1766.txt) describes these codes and their formats.
Not valid in base, br, frame, frameset, hr, iframe, param, and script elements.
Attribute | Value | Description |
---|---|---|
dir | ltr | rtl | Sets the text direction |
lang | language_code | Sets the language code |
Advertisements