HTML and CSS Reference
In-Depth Information
HTML5 Global Attributes
A number of attributes are shared by all elements in HTML5 and are referred to collectively
as the
Global Attributes
:
accesskey="
character
character
"
Assigns an access key (shortcut key command) that activates or focuses the element. The
value is a single character. Users may access the element by hitting Alt-<
key
> (PC) or
Ctrl-<
key
> (Mac).
class="
text string
text string
"
Assigns one or more classification names to the element.
contenteditable="true|false"
Not in HTML 4.01
. Indicates the user can edit the element. This attribute is already well
supported in current browser versions.
contextmenu="
id of menu element
id of menu element
"
Not in HTML 4.01
. Specifies a context menu that applies to the element. The context
menu must be requested by the user, for example, by a right-click.
dir="ltr|rtl|auto"
Specifies the direction of the element.
ltr
indicates left to right;
rtl
indicates right to left;
and
auto
indicates that direction should be determined programmatically.
draggable="true|false"
Not in HTML 4.01
.Indicates theelement isdraggable,meaningitcanbemovedbyclick-
ing and holding on it, and then moving it to a new position in the window.