HTML-5.com HTML Attribute Reference itemprop=title>HTML 5 ...

uglyveinInternet και Εφαρμογές Web

24 Ιουν 2012 (πριν από 5 χρόνια και 6 μήνες)

519 εμφανίσεις

HTML-5.com
HTML Attribute Reference
© 2011 Accilent Corp.
Page 1 of 6
1
HTML Attribute Reference
A comprehensive reference to the HTML global attributes and element attributes for web
developers who code in the HTML language. HTML Rules explains the rules for coding web
pages and other content in HTML.
HTML-5.com
➢ itemscopehttp://data-vocabulary.org/Breadcrumb<span
itemprop="title">HTML 5</span>
➢ itemscopehttp://data-vocabulary.org/Breadcrumb
HTML Attribute Reference
Coding HTML Attributes
An <dfn>attribute</dfn> is a named property
associated with an element
. In a marked-up
document, attributes are coded in a starting tag or standalone tag
between the element
name and the tag's terminating
/> or
> delimiter. The code for an HTML attribute consists
of the attribute name, an equal sign (
=) and the value of the property enclosed in quotes:
<<i mode="pre">elemname</i> <i mode="pre">attrname</i> ="<i mode="pre">value</i> ">...</<i mode="pre">elemname</i> >
<<i mode="pre">elemname</i> <i mode="pre">attrname</i> ="<i mode="pre">value</i> "/>
Coding Boolean Attributes
Boolean attributes should be coded in their full form using the attribute name in quotes
(
attribute="attribute") when the value is true and completely omitting the attribute
when the value is false. The full form will be properly understood by web browsers parsing
polyglot documents with either the HTML syntax or the XML syntax of HTML 5. Avoid
using minimized attributes, such as
selected, or values with an empty string, such as in
selected="", which XPath treats as false rather than true.
<<a mode="pre" href="../tags/input-tag">input</a> <a mode="pre" href="../tags/input-tag#type-attribute">type="text"</a> <a mode="pre" href="../tags/input-tag#readonly-attribute">readonly="readonly"</a> />
<<a mode="pre" href="../tags/input-tag">input</a> <a mode="pre" href="../tags/input-tag#type-attribute">type="text"</a> <a mode="pre" href="../tags/input-tag#required-attribute">required="required"</a> />
<<a mode="pre" href="../tags/option-tag">option</a> <a mode="pre" href="../tags/option-tag#selected-attribute">selected="selected"</a> />
<<a mode="pre" href="../tags/video-tag">video</a> <a mode="pre" href="../tags/video-tag#autoplay-attribute">autoplay="autoplay"</a> ...>
<span style="font-weight: bold; color: #cc0000">WARNING:</span> Be careful when
looking for web sites for learning HTML, especially when it comes to things that are treated
differently by different browsers. For instance, the examples on some very popular web
sites show the value
"false"
as valid for boolean attributes
, which is treated as false by
browsers that look at the attribute value and as true by other browsers that only look for the
presence or absence of the attribute, resulting in very inconsistent behavior, since that is
incorrect coding per the HTML specification:
<blockquote style="margin-top: 0"> The values "true" and "false" are not allowed on boolean
attributes.
</blockquote>
To determine what version of HTML a web page is actually using, enter its URL in the W3C
Markup Validation Service
and look for the Doctype. If it's not HTML5, change it to HTML5
in the drop-down box and then Revalidate. The pages on this site are Valid HTML 5
.
back to top
Global Attributes List
Global (Common) Attributes
These are the common (global) HTML attributes that can be used on most HTML tags
.
HTML Attribute Reference
HTML-5.com
2
Page 2 of 6
© 2011 Accilent Corp.
The
accesskey
Attribute
The
class
Attribute
The
contenteditable
Attribute
The
contextmenu
Attribute
The Author-Defined
data-*
Attributes
The
dir
Attribute
The
draggable
Attribute
The
dropzone
Attribute
The
hidden
Attribute
The
id
Attribute
The Microdata
item...
Attributes
The
lang
Attribute
The
on...
Event Attributes
The
spellcheck
Attribute
The
style
Attribute
The
tabindex
Attribute
The
title
Attribute
XML Atttributes in HTML
xmlns
and xml:space
The other HTML attributes are limited to specific HTML tags.
back to top
Element Attribute Index
The table below uses the
<tag attribute> notation indicating the namespace partition
as described in the HTML Namespaces and Namespace Declarations Tutorial
.
Attribute
Tag(s) Where Valid
accept
<input accept>
Attribute
Tag(s) Where Valid
on...
on... Event
Attributes
HTML-5.com
HTML Attribute Reference
© 2011 Accilent Corp.
Page 3 of 6
3
accept-charset
<form accept-
charset>
accesskey
accesskey Global
Attribute
action
<form action>
alt
<area alt>
<img alt>
<input alt>
async
<script async>
autocomplete
<form
autocomplete>
<input
autocomplete>
autofocus
<button autofocus>
<input autofocus>
<keygen autofocus>
<select autofocus>
<textarea
autofocus>
autoplay
<audio autoplay>
<video autoplay>
challenge
<kengen challenge>
charset
<meta charset>
<script charset>
checked
<command
checked>
<input
checked>
cite
<blockquote cite>
<del cite>
<ins cite>
<q cite>
class
class Global
Attribute
codecs
<source codecs>
cols
<textarea cols>
colspan
<td colspan>
<th
colspan>
compact
<ol compact>
content
<meta content>
contenteditable
contenteditable
Global Attribute
onblur
<body onblur>
oncanplay
<audio oncanplay>
<video oncanplay>
oncanplaythrough
<audio
oncanplaythrough>
<video
oncanplaythrough>
onemptied
<audio onemptied>
<video onemptied>
onended
<audio onended>
<video onended>
onerror
<audio onerror>
<body onerror>
<video onerror>
onfocus
<body onfocus>
onload
<body onload>
onloadeddata
<audio
onloadeddata>
<video
onloadeddata>
onloadedmetadata
<audio
onloadedmetadata>
<video
onloadedmetadata>
onloadstart
<audio onloadstart>
<video onloadstart>
onpause
<audio onpause>
<video onpause>
onplaying
<audio onplaying>
<video onplaying>
onprogress
<audio onprogress>
<video onprogress>
onratechange
<audio
onratechange>
<video
onratechange>
onreadystatechange
<audio
onreadystatechange>
<video
onreadystatechaneg>
onscroll
<body onscroll>
HTML Attribute Reference
HTML-5.com
4
Page 4 of 6
© 2011 Accilent Corp.
controls
<audio controls>
<video controls>
coords
<area coords>
data
<object data>
data-*
data-* Author-
Defined Attributes
datetime
<del datetime>
<ins
datetime>
<time
datetime>
default
<track default>
defer
<script defer>
dir
dir Global Attribute
<bdi dir>
<bdo dir>
disabled
<button disabled>
<command
disabled>
<input
disabled>
<keygen
disabled>
<optgroup
disabled>
<option
disabled>
<select
disabled>
<textarea
disabled>
draggable
draggable Global
Attribute
dropzone
dropzone Global
Attribute
encoding
<?xml encoding?>
enctype
<form enctype>
form
<button form>
<input form>
<keygen form>
<object form>
<select form>
<textarea form>
formaction
<button formaction>
<input formaction>
formenctype
<button
formenctype>
<input
formenctype>
formmethod
<button
formmethod>
<input
formmethod>
onseeked
<audio onseeked>
<video onseeked>
onseeking
<audio onseeking>
<video onseeking>
onstalled
<audio onstalled>
<video onstalled>
onsuspend
<audio onsuspend>
<video onsuspend>
ontimeupdate
<audio
ontimeupdate>
<video
ontimeupdate>
onvolumechange
<audio
onvolumechange>
<video
onvolumechange>
onwaiting
<audio onwaiting>
<video onwaiting>
open
<details open>
pattern
<input pattern>
ping
<a ping>
<area
ping>
placeholder
<input placeholder>
<textarea
placeholder>
poster
<video poster>
preload
<audio preload>
<video preload>
pubdate
<time pubdate>
radiogroup
<command
radiogroup>
readonly
<input readonly>
<textarea readonly>
rel
<a rel>
<area rel>
<link rel>
required
<input required>
<textarea required>
reversed
<ol reversed>
HTML-5.com
HTML Attribute Reference
© 2011 Accilent Corp.
Page 5 of 6
5
formnovalidate
<button
formnovalidate>
<input
formnovalidate>
formtarget
<button formtarget>
<input formtarget>
headers
<td headers>
<th
headers>
height
<canvas height>
<embed height>
<iframe height>
<img height>
<input
height>
<object
height>
<video
height>
hidden
hidden Global
Attribute
href
<a href>
<area
href>
<base href>
<link href>
<?xml-
stylesheet href?>
hreflang
<a hreflang>
<area
hreflang>
<link
hreflang>
http-equiv
<meta http-equiv>
icon
<command icon>
id
id Global Attribute
<dfn id>
ismap
<img ismap>
itemid
itemid Microdata
Attribute
itemprop
itemprop Microdata
Attribute
itemref
itemref Microdata
Attribute
itemscope
itemscope Microdata
Attribute
itemtype
itemtype Microdata
Attribute
keytype
<keygen keytype>
kind
<track kind>
rows
<textarea rows>
rowspan
<td rowspan>
<th
rowspan>
sandbox
<iframe sandbox>
scope
<th scope>
scoped
<style scoped>
seamless
<iframe seamless>
selected
<option selected>
shape
<area shape>
size
<input size>
<select
size>
sizes
<link sizes>
span
<colgroup span>
spellcheck
spellcheck Global
Attribute
src
<audio src>
<embed
src>
<iframe src>
<img src>
<input
src>
<script src>
<source src>
<track
src>
<video src>
srcdoc
<iframe srcdoc>
srclang
<track srclang>
standalone
<?xml standalone?>
start
<ol start>
step
<input step>
style
style Global Attribute
<svg style>
tabindex
tabindex Global
Attribute
target
<a target>
<area
target>
<base
target>
<form
target>
title
title Global Attribute
<abbr title>
<command title>
<dfn title>
<link title>
<style title>
HTML Attribute Reference
HTML-5.com
6
Page 6 of 6
© 2011 Accilent Corp.
label
<command label>
<menu label>
<optgroup label>
<option label>
<track label>
lang
lang Global Attribute
language
<script language>
list
<input list>
loop
<audio loop>
<video
loop>
manifest
<html manifest>
max
<input max>
maxlength
<input maxlength>
<textarea
maxlength>
media
<a media>
<area
media>
<link
media>
<style
media>
method
<form method>
min
<input min>
multiple
<input multiple>
<select multiple>
name
<button name>
<form name>
<iframe name>
<input name>
<keygen name>
<meta name>
<object name>
<select name>
<textarea name>
novalidate
<form novalidate>
type
<a type>
<area
type>
<button type>
<command type>
<embed type>
<input type>
<link
type>
<menu type>
<object type>
<ol
type>
<script type>
<source type>
<style type>
<?xml-
stylesheet type?>
usemap
<img usemap>
<object usemap>
value
<button value>
<input value>
<option value>
version
<?xml version?>
<html version>
<svg
version>
width
<canvas width>
<embed width>
<iframe width>
<img
width>
<input width>
<object width>
<video width>
wrap
<textarea wrap>
xmlns
xmlns Global
Attribute
<html
xmlns>
<mathml
xmlns>
<svg xmlns>
back to top
THE END