HTML attribute: Difference between revisions

Content deleted Content added
Line 26:
HTML attributes are generally classed as '''required attributes''', '''optional attributes''', '''standard attributes''', and '''event attributes'''. Usually the required and optional attributes modify specific HTML elements, while the standard attributes can be applied to most HTML elements.<ref>{{cite web|url=http://www.w3schools.com/tags/ref_standardattributes.asp|title=HTML / XHTML Standard Attributes|publisher=w3schools.com}}</ref> Event attributes, added in HTML version 4, allow an element to specify scripts to be run under specific circumstances.<ref>{{cite web|url=http://www.w3schools.com/tags/ref_eventattributes.asp|title=HTML / XHTML Standard Event Attributes|publisher=w3schools.com}}</ref>
 
===Required and optional HTML attributes===
====Used by one tag====
* {{MDNHTMLRef|applet}}: {{MDNHTMLRef|applet|code}}, {{MDNHTMLRef|applet|object}}
* {{MDNHTMLRef|area}}: {{MDNHTMLRef|area|nohref}}
Line 50:
* {{MDNHTMLRef|td}}: {{MDNHTMLRef|td|headers}}
 
====Used by two tags====
* {{MDNHTMLRef|a}} and {{MDNHTMLRef|area}}:
** coords — coordinates of an {{MDNHTMLRef|area|coords|v=1}} or a {{MDNHTMLRef|link|coords|v=1}} within it.
Line 94:
** scope — no effect on normal browser display, but marks a table {{MDNHTMLRef|td|scope|t=cell}} or {{MDNHTMLRef|td|scope|t=header}} as a logical header for other cells. Values: col, colgroup, row, rowgroup.
 
====Used by multiple tags====
* '''align''' — {{MDNHTMLRef|applet|align|v=1}}, {{MDNHTMLRef|col|align|v=1}}, {{MDNHTMLRef|colgroup|align|v=1}}, {{MDNHTMLRef|object|align|v=1}}, {{MDNHTMLRef|tbody|align|v=1}}, {{MDNHTMLRef|td|align|v=1}}, {{MDNHTMLRef|tfoot|align|v=1}}, {{MDNHTMLRef|th|align|v=1}}, {{MDNHTMLRef|thead|align|v=1}}
:*align also deprecated in {{MDNHTMLRef|caption|align|v=1}}, {{MDNHTMLRef|div|align|v=1}}, {{MDNHTMLRef|h1|align|v=1}} to {{MDNHTMLRef|h6|align|v=1}}, {{MDNHTMLRef|hr|align|v=1}}, {{MDNHTMLRef|iframe|align|v=1}}, {{MDNHTMLRef|img|align|v=1}}, {{MDNHTMLRef|input|align|v=1}}, {{MDNHTMLRef|legend|align|v=1}}, {{MDNHTMLRef|p|align|v=1}}, {{MDNHTMLRef|table|align|v=1}}