HTML5参考手册(英文版)
- 格式:pdf
- 大小:626.79 KB
- 文档页数:14
TABLE A.1 HTML Global Attributes
The following attributes may be used with most HTML elements
Global Attribute Description
accesskey For adding a keyboard shortcut to an element
aria-* For associating accessibility attribute values specified by WAI-ARIA class For identifying a set of elements in order to apply styles to them contenteditable For making the content of an element editable
contextmenu For identifying a contextual menu for an element (the value must be the same as a menu element’s id attribute)
data-* For storing custom data that is private to the page or application
dir For specifying the element’s text direction
draggable For making an element draggable
dropzone For identifying an element as a place where draggable elements can be dropped
event For associating an element with a script (event is a placeholder for the actual event name) hidden For indicating that an element is not yet relevant or is no longer relevant
id For identifying a particular element so that it can be linked to, styled, or scripted with JavaScript lang For specifying the language an element is written in
role For providing additional information to assistive devices about the role of an element as defined by WAI-ARIA
spellcheck For indicating whether the content of an element should have its spelling and grammar checked style For adding local style sheet information
tabindex For defining the order in which the Tab key takes the visitor through elements
title For labeling elements with tool tips
TABLE A.2 HTML Elements and Attributes
Element/Attribute(s) Description
a For creating links and anchors
href For specifying the URL of a page or the name of an anchor that a link goes to
hreflang For specifying the language of the linked resource
media For describing the media for which the target document was defined
rel For identifying the nature of the link
target For specifying the window or iframe where a link should open
type For noting a resource’s MIME type
abbr For explaining the meaning of abbreviations and acronyms
address For identifying contact information for the nearest article or body element ancestor area For specifying the coordinates of image maps
accesskey For adding a keyboard shortcut to a particular region of the map
alt For giving information about an area
coords For giving the coordinates of an area in an image map
href For specifying the destination URL of a link in an area of an image map
hreflang For specifying the language of the linked resource
media For describing the media for which the target document was defined
rel For identifying the kind of link
shape For specifying the shape of an area in an image map
target For specifying the window or iframe where a link should open
article For identifying a self-contained composition in a page that is in principle independently distributable or reusable
aside For identifying a section of a page that consists of content that is tangentially related to the content around it
audio For embedding sound or audio in a page
autoplay For telling the browser to start playing the audio file as soon as it can
controls For telling the browser to provide controls for the audio element
crossorigin For setting cross-origin request credentials
loop For telling the audio file to start over without interruption upon reaching its end mediagroup For associating multiple media files together
muted For controlling the default state of audio output
preload For specifying whether the browser can begin downloading the audio file before the visitor starts playing it
src For identifying the URL of the audio file to play