HTML and CSS Reference
In-Depth Information
General Attributes
Several attributes are common to many page elements. Rather than repeating this infor-
mation each time it occurs, the following tables summarize these attributes.
Core Attributes
The following attributes apply to all page elements and are supported by most browser
versions.
Attribute
Description
class=” text
Specifies the class or group to which an element belongs
contenteditable=
text list
Specifies whether the contents of the element are editable (HTML5)
contextmenu=” id
Specifies the value of the id attribute on the menu with which to associate
the element as a context menu
draggable=”true|false”
Specifies whether the element is draggable (HTML5)
dropzone=
”copy|move|link”
Specifies what types of content can be dropped on the element and which
actions to take with content when it is dropped (HTML5)
hidden=”hidden”
Specifies that the element is not yet, or is no longer, relevant and that the
element should not be rendered (HTML5)
id=” text
Specifies a unique identifier to be associated with the element
spellcheck=”true|false”
Specifies whether the element represents an element whose contents are
subject to spell checking and grammar checking (HTML5)
style=” styles
Defines an inline style for the element
title=” text
Provides an advisory title for the element
Language Attributes
The Web is designed to be universal and has to be adaptable to languages other than
English. Thus, another set of attributes provides language support. This set of attributes is
not as widely supported by browsers as the core attributes are. As with the core attri-
butes, they can be applied to most page elements.
Attribute
Description
dir=” ltr |rtl”
Indicates the text direction as related to the lang attribute; a value of ltr displays text
from left to right; a value of rtl displays text from right to left
lang=” lang
Identifies the language used in the page content where lang is language code name
Form Attributes
The following attributes can be applied to most form elements or to a Web form itself,
but not to other page elements.
Attribute
Description
accesskey=” char
Indicates the keyboard character that can be pressed along with the accelera-
tor key to access a form element
disabled=”disabled”
Disables a form field for input
tabindex=” integer
Specifies a form element's position in a document's tabbing order
Search WWH ::




Custom Search