Content deleted Content added
m Reverted edits by 176.227.58.66 (talk) to last version by Rodw |
m Task 18 (cosmetic): eval 14 templates: del empty params (3×); hyphenate params (8×); |
||
Line 5:
Several basic attributes types have been recognized, including: (1) ''required attributes'', needed by a particular element type for that element type to function correctly; (2) ''optional attributes'', used to modify the default functionality of an element type; (3) ''standard attributes'', supported by many element types; and (4) ''event attributes'', used to cause element types to specify scripts to be run under specific circumstances.
Some attribute types function differently when used to modify different element types. For example, the attribute ''name'' is used by several element types, but has slightly different functions in each.<ref name="html4attributes">{{cite web | url=http://www.w3.org/TR/html4/index/attributes.html | title=Index of the HTML 4 Attributes | publisher=W3C |
==Description==
Line 12:
<syntaxhighlight lang="html"><element attribute="value">element content</element></syntaxhighlight>
Where <code>element</code> names the HTML element type, and <code>attribute</code> is the name of the attribute, set to the provided <code>value</code>. The value may be enclosed in single or double quotes, although values consisting of certain characters can be left unquoted in HTML (but not XHTML).<ref>{{cite web|url=http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2 |title=On SGML and HTML |publisher=World Wide Web Consortium |access-date
Although most attributes are provided as paired names and values, some affect the element simply by their presence in the start tag of the element<ref name="tagshtml">{{cite web|url=http://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Tags.html |title=Tags used in HTML |publisher=World Wide Web Consortium |date=November 3, 1992 |
The abbreviation element, <code>abbr</code>, can be used to demonstrate these various attributes:
Line 141:
==Standard attributes==
''Standard attributes'' are also known as ''global attributes'', and function with a large number of elements.<ref name="globalattribute">{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes |title=Global attributes - HTML (HyperText Markup Language) MDN |access-date
Technically all standard attributes must be accepted by all elements, though they will not function with some elements.<ref name="HTMLReference">{{cite web | url=https://developer.mozilla.org/en-US/docs/Web/HTML/Reference | title=HTML reference - HTML (HyperText Markup Language) MDN |
{| class="wikitable sortable"
|