Content deleted Content added
GreenC bot (talk | contribs) Move 1 url. Wayback Medic 2.5 |
m →Description: style="text-align: center;" |
||
Line 10:
HTML attributes generally appear as [[name-value pair]]s, separated by <code>=</code>, and are written within the start tag of an element, after the element's name:
<syntaxhighlight lang="
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=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 4|publisher=World Wide Web Consortium|access-date=November 16, 2008}}</ref> Leaving attribute values unquoted is considered unsafe.<ref>{{cite web|first=Jukka|last=Korpela|url=https://jkorpela.fi/qattr.html|title=Why attribute values should always be quoted in HTML|publisher=Cs.tut.fi |date=July 6, 1998|access-date=November 16, 2008}}</ref>
Line 22:
This example displays as <span id="anId" class="aClass" style="color:blue;" title="Hypertext Markup Language">HTML</span> in blue without being a link, and in most browsers, pointing the cursor at the abbreviation should display the title text "Hypertext Markup Language" within a floating yellow background ([[tooltip]]).
<syntaxhighlight lang="html"><div style="
In this other example, your text will look like this:
|