HTML attribute: Difference between revisions

Content deleted Content added
No edit summary
m Reverted edits by 182.185.167.18 (talk) to last revision by Mimarx (HG)
Line 4:
::Where ''tag'' names the HTML element, ''attribute'' is the name of the attribute, set to the provided ''value''.
 
haseeb 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 |date=|accessdate=November 16, 2008}}</ref><ref>{{cite web|url=http://www.w3.org/TR/xhtml1/diffs.html#h-4.4|title=XHTML 1.0 - Differences with HTML&#160;4|publisher=World Wide Web Consortium|date=|accessdate=November 16, 2008}}</ref> Leaving attribute values unquoted is considered unsafe.<ref>{{cite web|first=Jukka|last=Korpela|url=http://www.cs.tut.fi/~jkorpela/qattr.html|title=Why attribute values should always be quoted in HTML|publisher=Cs.tut.fi |date=July 6, 1998|accessdate=November 16, 2008}}</ref>
 
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 |accessdate=November 16, 2008}}</ref> (like the <code>ismap</code> attribute for the <code>img</code> element<ref>{{cite web|url=http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#adef-ismap|title=Objects, Images, and Applets in HTML documents |publisher=World Wide Web Consortium |date=December 24, 1999|accessdate=November 16, 2008}}</ref>).