You are on page 1of 51

HTML5Reference

TheSyntax,VocabularyandAPIsofHTML5
W3CEditorsDraft9August2010
Thisversion:
http://www.w3.org/TR/2010/EDhtml5author20100809
Latestversion:
http://www.w3.org/TR/
Previousversion:
Nopreviousversions.
Editors:
LachlanHunt(OperaSoftwareASA)lachlan.hunt@lachy.id.au
[Copyrightlicencepending]

Abstract
Thisdocumentexplainsthesyntax,vocabularyandtheavailableAPIsforHTML5documents,focussingonsimplicityandpractical
applicationsforbeginnerswhilealsoprovidingindepthinformationformoreadvancedwebdevelopers.Thisdocumentis
complimentarytotheHTML5Guide.

Statusofthisdocument
Thissectiondescribesthestatusofthisdocumentatthetimeofitspublication.Otherdocumentsmaysupersedethisdocument.A
listofcurrentW3CpublicationsandthelatestrevisionofthistechnicalreportcanbefoundintheW3Ctechnicalreportsindexat
http://www.w3.org/TR/.
ThisdocumentisanEditorsDraftoftheHTML5ReferenceproducedbytheHTMLWorkingGroup,partoftheHTMLActivity.The
workinggroupisworkingonHTML5(seetheHTML5Editorsdraft).Theappropriateforumforcommentsonthisdocumentis
publichtmlcomments@w3.org(publicarchive)orpublichtml@w3.org(publicarchive).
PublicationasaWorkingGroupNotedoesnotimplyendorsementbytheW3CMembership.Thisisadraftdocumentandmaybe
updated,replacedorobsoletedbyotherdocumentsatanytime.Itisinappropriatetocitethisdocumentasotherthanworkin
progress.
Thisdocumentwasproducedbyagroupoperatingunderthe5February2004W3CPatentPolicy.W3Cmaintainsapubliclistof
anypatentdisclosuresmadeinconnectionwiththedeliverablesofthegroupthatpagealsoincludesinstructionsfordisclosinga
patent.AnindividualwhohasactualknowledgeofapatentwhichtheindividualbelievescontainsEssentialClaim(s)mustdisclose
theinformationinaccordancewithsection6oftheW3CPatentPolicy.

Tableofcontents
1Introduction
2BasicTemplates
3TheHTMLandXHTMLSyntax
3.1SyntacticOverview
3.2TheSyntax
3.2.1DOCTYPEDeclaration
3.2.1.1ObsoleteButPermittedDOCTYPEs
3.2.1.2HTMLandXHTMLComparison
3.2.1.3HistoricalNotes
3.2.2Elements
3.2.2.1Tags
3.2.2.2VoidElements
3.2.2.3RawTextElements
3.2.2.4RCDATAElements
3.2.2.5ForeignElements
3.2.2.6NormalElements
3.2.2.7ElementTypeComparision
3.2.2.8HTMLandXHTMLComparison
3.2.3Attributes
3.2.3.1EmptyAttributeSyntax
3.2.3.2UnquotedAttributeValueSyntax

3.2.3.3DoubleQuotedAttributeValueSyntax
3.2.3.4SingleQuotedAttributeValueSyntax
3.2.3.5HTMLandXHTMLComparison
3.2.4Comments
3.2.5Text
3.2.6CDATASections
3.2.7CharacterReferences
3.3UnderstandingMIMETypes
3.4CharacterEncoding
3.5ChoosingHTMLorXHTML
3.6PolyglotDocuments
4TheHTMLVocabularyandAPIs
4.1Categories
4.1.1MetadataContent
4.1.2Flowcontent
4.1.3Sectioningroot
4.1.4Sectioningcontent
4.1.5Headingcontent
4.1.6Phrasingcontent
4.1.7Embeddedcontent
4.1.8Interactivecontent
4.1.9TransparentContentModels
4.2GlobalAttributes
4.3TheElements
4.3.1TheRootElement
4.3.1.1Thehtmlelement
4.3.2DocumentMetadata
4.3.2.1Theheadelement
4.3.2.2Thetitleelement
4.3.2.3Thebaseelement
4.3.2.4Thelinkelement
4.3.2.5Themetaelement
4.3.2.6Thestyleelement
4.3.3Scripting
4.3.3.1Thescriptelement
4.3.3.2Thenoscriptelement
4.3.4Sections
4.3.4.1Thebodyelement
4.3.4.2Thesectionelement
4.3.4.3Thenavelement
4.3.4.4Thearticleelement
4.3.4.5Theasideelement
4.3.4.6Theh1,h2,h3,h4,h5,andh6elements
4.3.4.7Theheaderelement
4.3.4.8Thefooterelement
4.3.4.9Theaddresselement
4.3.4.10HeadingsandSections
4.3.5GroupingContent
4.3.5.1Thepelement
4.3.5.2Thehrelement
4.3.5.3Thebrelement
4.3.5.4Thepreelement
4.3.5.5Thedialogelement
4.3.5.6Theblockquoteelement
4.3.5.7Theolelement
4.3.5.8Theulelement
4.3.5.9Thelielement
4.3.5.10Thedlelement
4.3.5.11Thedtelement
4.3.5.12Theddelement
4.3.6TextLevelSemantics
4.3.6.1Theaelement
4.3.6.2Theqelement
4.3.6.3Theciteelement
4.3.6.4Theemelement
4.3.6.5Thestrongelement
4.3.6.6Thesmallelement
4.3.6.7Themarkelement
4.3.6.8Thedfnelement
4.3.6.9Theabbrelement
4.3.6.10Thetimeelement
4.3.6.11Theprogresselement
4.3.6.12Themeterelement
4.3.6.13Thecodeelement
4.3.6.14Thevarelement
4.3.6.15Thesampelement
4.3.6.16Thekbdelement

4.3.6.17Thesubandsupelements
4.3.6.18Thespanelement
4.3.6.19Theielement
4.3.6.20Thebelement
4.3.6.21Thebdoelement
4.3.6.22Therubyelement
4.3.6.23Thertelement
4.3.6.24Therpelement
4.3.7Edits
4.3.7.1Theinselement
4.3.7.2Thedelelement
4.3.8EmbeddedContent
4.3.8.1Thefigureelement
4.3.8.2Theimgelement
4.3.8.3Theiframeelement
4.3.8.4Theembedelement
4.3.8.5Theobjectelement
4.3.8.6Theparamelement
4.3.8.7Thevideoelement
4.3.8.8Theaudioelement
4.3.8.9Thesourceelement
4.3.8.10Thecanvaselement
4.3.8.11Themapelement
4.3.8.12Theareaelement
4.3.9TabularData
4.3.9.1Thetableelement
4.3.9.2Thecaptionelement
4.3.9.3Thecolgroupelement
4.3.9.4Thecolelement
4.3.9.5Thetbodyelement
4.3.9.6Thetheadelement
4.3.9.7Thetfootelement
4.3.9.8Thetrelement
4.3.9.9Thetdelement
4.3.9.10Thethelement
4.3.10Forms
4.3.10.1Theformelement
4.3.10.2Thefieldsetelement
4.3.10.3Thelabelelement
4.3.10.4Theinputelement
4.3.10.5Thebuttonelement
4.3.10.6Theselectelement
4.3.10.7Thedatalistelement
4.3.10.8Theoptgroupelement
4.3.10.9Theoptionelement
4.3.10.10Thetextareaelement
4.3.10.11Theoutputelement
4.3.11InteractiveElements
4.3.11.1Thedetailselement
4.3.11.2Thecommandelement
4.3.11.3Thebbelement
4.3.11.4Themenuelement
4.3.12MiscellaneousElements
4.3.12.1Thelegendelement
4.3.12.2Thedivelement
4.4Microdata
5IndexofElements
5.1ConformingElements
5.2ObsoleteElements
5.3ComparisonofHTML4.01andHTML5Elements
6HowtoReadThisGuide
6.1Conventions
6.1.1Notes,TipsandWarnings
6.1.2ExampleMarkup
6.1.2.1Attributes
6.1.2.2VoidElements
6.1.2.3Namespaces

1Introduction
ThisdocumentservesasareferencefortheHTMLsyntax,vocabularyanditsassociatedDOMAPIsandisintendedforwebsite
andapplicationdevelopers,publishers,tutorialwritersandteachersandtheirstudents.Thatis,peoplewhowritedocumentsusing
HTML,orwhoteachotherstodoso.
Thisguideisstructuredintothreemajorsections.Thefirstprovidesasetofbasictemplatesforauthorstogetstartedwith.

ThesecondsectionprovidesanindepthlookatthesyntaxofHTMLandXHTMLdocuments.Thiswillinvestigateboththe
similaritiesanddifferencesbetweenthetwoalternativesandprovidesguidanceonchoosingwhichtouseforyourownprojects,
dependingonyourneeds.Additionally,thiswillalsoprovidedetailsaboutcreatingpolyglotdocumentsthatis,documentsthat
conformtobothHTMLandXHTMLsimultaneiouslyincludingissuesrelatedtoensuringstylesheetsandscriptsworkcorrectly
underbothconditions.
ThethirdandfinalsectionprovidesareferencefortheHTMLvocabulary.Eachelementisdescribed,providingdetailsaboutitsits
meaning,allowedattributes,contentmodelsandDOMAPIs.Eachisaccompaniedbyclearexamplesillustratinghowtheelementis
designedtobeusedforarangeofdifferentusecases.

2BasicTemplates
Thefollowingbasictemplatesaredesignedtobeusedasstartingpointsforthedocumentsyoucreate.Severalalternativesare
provided,allowingindividualstochoosethetemplatethatismostappropriatefortheirneeds.
Simple:HTML:
Themostbasictemplaterecommendedformostauthors.
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF8">
<title>HTMLTemplate</title>
</head>
<body>
<p>Insertcontenthere.</p>
</body>
</html>
Intermediate:HTMLandXHTMLPolyglot:
Templatesuitableforintermediateauthorswhoareproducingdocumentsadheringtothepolyglotmarkupconventions.Whilethistemplateissafefor
beginnerstouse,itisonlyrecommendedforauthorsfamiliarwiththetechniquesforcreatingpolyglotdocuments.
<!DOCTYPEhtml>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metacharset="UTF8"/>
<title>Polyglot(X)HTMLTemplate</title>
</head>
<body>
<p>Insertcontenthere.</p>
</body>
</html>
Advanced:XHTML:
TemplatesuitableforadvancedauthorswhoareproducingXHTMLdocuments.ThistemplateisnotsuitableforuseasHTMLbecauseitlacksthe
DOCTYPEanddoesnotdeclarethecharacterencoding.AuthorsusingthistemplateshouldbeusingUTF8orUTF16,orshouldatleastbeawareofhow
todeclarethecorrectencodingforXML.
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XHTMLTemplate</title>
</head>
<body>
<p>Insertcontenthere.</p>
</body>
</html>
Advanced:MinimalHTML:
TemplatesuitableforadvancedauthorswhoareproducingHTMLdocuments.Thistemplatetakesadvantageoftheabilitytoomitcertaintagsforsome
elements.Authorswhoarenotfamiliarwith,orareuncomfortablewith,thesefeaturesshouldavoidthistemplate.
<!DOCTYPEhtml>
<metacharset="UTF8">
<title>MinimalHTMLTemplate</title>
<p>Insertcontenthere.</p>

3TheHTMLandXHTMLSyntax
ItisusefultomakeadistinctionbetweenthevocabularyofanHTMLdocumenttheelementsandattributes,andtheirmeanings
andthesyntaxinwhichitiswritten.
HTMLhasadefinedsetofelementsandattributeswhichcanbeusedinadocumenteachdesignedforaspecificpurposewith
theirownmeaning.Considerthissetofelementstobeanalogoustothelistofwordsinadictionary.Thisincludeselementsfor
headings,paragraphs,lists,tables,links,formcontrolsandmanyotherfeatures.ThisisthevocabularyofHTML.Similarly,justas
naturallanguageshavegrammaticalrulesforhowdifferentwordscanbeused,HTMLhasrulesforwhereandhoweachelement
andattributecanbeused.
ThebasicstructureofelementsinanHTMLdocumentisatreestructure.Mostelementshaveatmostoneparentelement,(except
fortherootelement),andmayhaveanynumberofchildelements.Thisstructureneedstobereflectedinthesyntaxusedtowrite

thedocument.

3.1SyntacticOverview
Therearetwosyntaxesthatcanbeused:thetraditionalHTMLsyntax,andtheXHTMLsyntax.Whilethesearesimilar,eachis
optimisedfordifferentneedsandauthoringhabits.Theformerismorelenientinitsdesignandhandlingrequirements,andhasa
numberofconvenientshorthandsforauthorstouse.ThelatterisbasedonXMLandhasmuchstrictersyntacticrequirements,
designedtodiscouragetheproliferationofsyntacticerrors.
TheHTMLsyntaxislooselybasedupontheolder,thoughverywidelyusedsyntaxfromHTML4.01.Althoughitisinspiredbyits
SGMLorigins,inpractice,itreallyonlysharesminorsyntacticsimilarities.Thisfeaturesarangeofshorthandsyntaxes,designedto
makehandcodingmoreconvenient,suchasallowingtheomissionofsomeoptionaltagsandattributevalues.Authorsarefreeto
choosewhetherornottheywishtotakeadvantageoftheseshorthandfeaturesbasedupontheirownpersonalpreferences.
HTMLExample:
AbasicHTMLdocument,demonstratingsomeshorthandsyntax.
<!DOCTYPEhtml>
<html>
<head>
<title>AnHTMLDocument</title>
</head>
<bodyclass=example>
<h1>Example</h1>
<p>ThisisanexampleHTMLdocument.
</body>
</html>

XHTML,however,isbasedonthemuchmorestrictXMLsyntax.WhilethistooisinspiredbySGML,thissyntaxrequiresdocuments
tobewellformed,whichsomepeoplepreferbecauseofitsstrictererrorhandling,forcingauthorstomaintaincleanermarkup.
XHTMLExample:
AbasicXHTMLdocument,demonstratingthestricterXMLsyntax.
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AnHTMLDocument</title>
</head>
<bodyclass="example">
<h1>Example</h1>
<p>ThisisanexampleHTMLdocument.</p>
</body>
</html>

Note:TheXHTMLdocumentdoesnotneedtoincludetheDOCTYPEbecauseXHTMLdocumentsthataredeliveredcorrectlyusing
anXMLMIMEtypeandareprocessedasXMLbybrowsers,arealwaysrenderedinnoquirksmode.However,theDOCTYPEmay
optionallybeincluded,andshouldbeincludedifthedocumentusesthecompatiblesubsetofmarkupthatisconforminginboth
HTMLandXHTML,andiseverexpectedtobeusedintext/htmlenvironments.
DuetothesimilaritiesofboththeHTMLandXHTMLsyntaxes,itispossibletomarkupdocumentsusingacommonsubsetofthe
syntaxthatisthesameinboth,whileavoidingthesyntacticfeaturesthatareuniquetoeach.Thistypeofdocumentissaidtouse
polyglotmarkup,oftensimplyreferredtoasapolyglotdocument,becauseitsimultaneouslyconformstobothsyntaxesandmaybe
treatedaseither.Thereareanumberofissuesinvolvedwithcreatingsuchdocumentsandauthorswishingtodososhould
familiarisethemselveswiththesimilaritiesanddifferencesbetweenHTMLandXHTML.

3.2TheSyntax
ThereareanumberofbasiccomponentsmakeupthesyntaxofHTML,thatareusedthroughoutanydocument.Theseincludethe
DOCTYPEdeclaration,elements,attributes,comments,textandCDATAsections.
3.2.1DOCTYPEDeclaration
TheDocumentTypeDeclarationneedstobepresentatthebeginningofadocumentthatusestheHTMLsyntax.Itmayoptionally
beusedwithintheXHTMLsyntax,butitisnotrequired.ThefollowingDOCTYPEisstronglyrecommendedformostHTML
documents:
Example:
TheHTML5DOCTYPEdeclaration.
<!DOCTYPEhtml>

ForcompatibilitywithlegacyproducersofHTMLthatis,softwarethatoutputsHTMLdocumentsanalternativelegacy
compatibilityDOCTYPEisavailable.ThisisrecommendedforusebysystemsthatareunabletooutputtheDOCTYPEgivenabove.
ThislimitationoccursinsoftwarethatexpectsaDOCTYPEtoincludeeitheraPUBLICorSYSTEMidentifier,andisunabletoomitthem.
ThecanonicalformofthisDOCTYPEisasfollows:
Example:
TheHTML5legacycompatibilityDOCTYPEdeclaration.

<!DOCTYPEhtmlSYSTEM"about:legacycompat">

PublicIdentifier

HTML

XHTML
SystemIdentifier

Note:Theterm"legacycompat"referstocompatibilitywithlegacyproducersonly.Inparticular,itdoesnotrefertocompatibilitywith
legacybrowsers,which,inpractice,ignoreSYSTEMidentifiersandDTDs.
InHTML,theDOCTYPEiscaseinsensitive,exceptforthequotedstring"about:legacycompat",whichmustbewritteninlowercase.
Thisquotedstring,however,mayalsobequotedwithsinglequotes,ratherthandoublequotes.Thehighlightedfragmentsbelow
illustratewhichpartsarecaseinsensitiveinHTML.
Example:
ThethreeconformingvariantsoftheHTML5DOCTYPEdeclarations,indicatingcaseinsensitivityintheHTMLsyntax.
<!DOCTYPEhtml>
<!DOCTYPEhtmlSYSTEM"about:legacycompat">
<!DOCTYPEhtmlSYSTEM'about:legacycompat'>

ForXHTML,theDOCTYPEmaybeomittedbecauseitisunnecessary.IfyouchoosetouseaDOCTYPE,thenthecanonicalcase
sensitiveversionsoftheaboveDOCTYPEsarerecommended.Buttherearenorestrictionsplacedontheuseofalternative
DOCTYPEs.Youmay,ifyouwish,useacustomDOCTYPEreferringtoacustomDTD,typicallyforvalidationpurposes.Although,
beadvisedthatDTDshaveanumberoflimitationscomparedwithotheralternativeschemalanguagesandvalidationtechniques.
3.2.1.1ObsoleteButPermittedDOCTYPEs
InordertoeasethethetransitionalprocessfrompreviouseditionsofHTML,selectedlegacyDOCTYPEsaregrandfatheredintothe
HTMLsyntaxasconforming,buttheyareconsideredobsolete.ThisdoesnotapplytoXHTML.
Warning:WhenusingtheseDOCTYPEs,somevalidatorsmayapplyconformancerequirementsfromolderspecifications,insteadof
therequirementsofHTML5.HTML5conformancecheckersarerequiredtoissueawarningifoneispresent.Authorsarestrongly
discouragedfromusingtheseDOCTYPEs.
ForthepermittedDOCTYPEsusingonlyapublicidentifier,thesyntaxisasfollows.Thehighlightedfragmentsindicatecase
insensitivityintheHTMLsyntax.
HTMLExample:
TheobsoletebutpermittedHTML4.01StrictDOCTYPEwithonlythepublicidentifier.
<!DOCTYPEhtmlPUBLIC"//W3C//DTDHTML4.01//EN">

ForthepermittedDOCTYPEsthatalsohaveasystemidentifier,thesyntaxis:
HTMLExample:
TheobsoletebutpermittedHTML4.01StrictDOCTYPEwithboththepublicandsystemidentifiers.
<!DOCTYPEhtmlPUBLIC"//W3C//DTDHTML4.01//EN"
SYSTEM"http://www.w3.org/TR/html4/strict.dtd">

Inadditiontothose,thefollowingpublicandsystemidentifiersinthetablebelowmaybesubstitutedaccordingly.
AllowedvaluesforpublicandsystemidentifiersinanobsoletepermittedDOCTYPEstring.
PublicIdentifier
SystemIdentifier
//W3C//DTDHTML4.0//EN
//W3C//DTDHTML4.0//EN

http://www.w3.org/TR/REChtml40/strict.dtd

//W3C//DTDHTML4.01//EN
//W3C//DTDHTML4.01//EN

http://www.w3.org/TR/html4/strict.dtd

//W3C//DTDXHTML1.0Strict//EN

http://www.w3.org/TR/xhtml1/DTD/xhtml1strict.dtd

//W3C//DTDXHTML1.1//EN

http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd

3.2.1.2HTMLandXHTMLComparison

DOCTYPE
DOCTYPEkeyword

ComparisonoftheDOCTYPEsyntaxrequirementsbetweenHTMLandXHTML
HTML
XHTML
Required
Optional
Caseinsensitive
Caseinsensitive

Casesensitive
Casesensitive

PublicIdentifier

Caseinsensitive
Caseinsensitive
Optional

Casesensitive
Casesensitive
Optional

SystemIdentifier

Optional

Optional,butrequiredifpublicidentifierispresent

htmlkeyword
PUBLICkeyword
SYSTEMkeyword

LegacyCompatibility
DOCTYPE
OtherDOCTYPEs

Allowed

HTML

Obsoletebutpermitted
DOCTYPElist

Allowed

XHTML

AnyXMLcompliantDOCTYPE(excludesHTML4.01andearlier
DOCTYPEs)

3.2.1.3HistoricalNotes
Thissectionneedsrevisingandmaybemovedtoanexternaldocumentandsimplyreferredto.
TheDOCTYPEoriginatesfromHTMLsSGMLlineageand,inpreviouslevelsofHTML,wasoriginallyusedtorefertoaDocument
TypeDefinition(DTD)aformaldeclarationoftheelements,attributesandsyntacticfeaturesthatcouldbeusedwithinthe
document.ThosewhoarefamiliarwithpreviouslevelsofHTMLwillnoticethatthereisnoPUBLICidentifierpresentinthis
DOCTYPE,whichwereusedtorefertotheDTD.Also,notethattheabout:URIschemeintheSYSTEMidentifierofthelatter
DOCTYPEisusedspecificallybecauseitcannotberesolvedtoanyspecificDTD.
AsHTML5isnolongerformallybaseduponSGML,theDOCTYPEnolongerservesthispurpose,andthusnolongerneedstorefer
toaDTD.However,duetolegacyconstraints,ithasgainedanotherveryimportantpurpose:triggeringnoquirksmodeinbrowsers.
HTML5definesthreemodes:quirksmode,limitedquirksmodeandnoquirksmode,ofwhichonlythelatterisconsidered
conformingtouse.Thereasonforthisisduetobackwardscompatibility.Theimportantthingtounderstandisthattherearesome
differencesinthewaydocumentsarevisuallyrenderedineachofthemodesandtoensurethemoststandardscompliant
rendering,itisimportanttoensurenoquirksmodeisused.
3.2.2Elements
Therearefivedifferentkindsofelements:normal,void,rawtext,RCDATAandforeignelements.Eachisrepresentedsyntactically
byatag.Whilethetypeshavesomesimilaritiestoeachother,theyaredistinguishedbytheirsyntacticrequirementsfortheircontent
modelsandthetypesoftagsthatmaybeused.
3.2.2.1Tags
Allelementsareidentifiedbytheirtagnameandaremarkedupusingeitherstarttagsandendtagsorselfclosingtags.Astarttag
marksthebeginningofanelement,whileanendtagmarkstheend.Starttagsaredelimitedusinganglebracketswiththetagname
andanyattributesinbetween.Endtagsaredelimitedbyanglebracketswithaslashbeforethetagname.
Example:
Themarkupforthestartandendtagsofthepelement.
<p>Thequickbrownfoxjumpsoverthelazydog.</p>

ASelfclosingtagisaspecialformofstarttagwithaslashimmediatelybeforetheclosingrightanglebracket.Theseindicatethat
theelementistobeclosedimmediately,andhasnocontent.Wherethissyntaxispermittedandused,theendtagmustbeomitted.
InHTML,theuseofthissyntaxisrestrictedtovoidelementsandforeignelements.Ifitisusedforotherelements,itistreatedasa
starttag.InXHTML,itispossibleforanyelementtousethissyntax.Butnotethatitisonlyconformingforelementswithcontent
modelsthatpermitthemtobeempty.
Example:
Abrelementusingtheselfclosingtagsyntax.
<p>Thequickbrownfox<br/>
jumpsoverthelazydog.</p>

InHTML,tagnamesarecaseinsensitive.Itisconventionaltousetheircanonicalcase,butthisisnotrequired.Forexample,they
couldbewritteninalluppercaseormixedcase,dependingonyourownpreferences.
HTMLExample:
UppercasetagnamesarepermittedintheHTMLsyntax.
<DIV>...</DIV>

InXHTML,tagnamesarecasesensitiveandmustbewrittenintheircanonicalcase.Ingeneral,thecanonicalcaseislowercasefor
HTMLandMathMLelements,andcamelcaseforSVG.Refertothedefinitionofeachelementifindoubt.
InbothHTMLandXHTML,withineachtag,whitespaceispermittedafterthetagname,butitisnotpermittedbeforethetagname.
Someauthorschoosetoincludeaspacebeforetheslashintheselfclosingtag.Thispracticeisbaseduponaconventionthat
originatedwithinthecompatibilityguidelinesinXHTML1.0,AppendixC.However,adherencetothisconventionisunnecessary.
Thepermittedsyntaxofeachelementanditscontentmodelvariesbasedonthetypeofelement.Thetermemptyelementisused
todescribeanelementthatcontainsnocontent.Elementsofanytypecanbeempty,dependingontheircontentmodel.Depending
onthetype,thesearerepresentedeitherbyastarttagthatisimmediatelyclosed,eitherimplicitlyorbythepresenceofanendtag,
orbyusingtheselfclosingtagsyntax.

Example:
Anemptyspanelement.
<span></span>

3.2.2.2VoidElements
Thetermvoidelementsisusedtodesignateelementsthatmustbeempty.TheserequirementsonlyapplytotheHTMLsyntax.In
XHTML,allsuchelementsaretreatedasnormalelements,butmustbemarkedupasemptyelements.
Theseelementsareforbiddenfromcontaininganycontentatall.InHTML,theseelementshaveastarttagonly.Theselfclosingtag
syntaxmaybeused.Theendtagmustbeomittedbecausetheelementisautomaticallyclosedbytheparser.
HTMLExample:
AvoidelementintheHTMLsyntax.ThisisnotpermittedintheXHTMLsyntax.
<hr>
Example:
AvoidelementusingtheHTMLandXHTMLcompatibleselfclosingtagsyntax.
<hr/>
XHTMLExample:
AvoidelementusingtheXHTMLonlysyntaxwithanexplicitendtag.ThisisnotpermittedforvoidelementsintheHTMLsyntax.
<hr></hr>

Suchelementsinclude,amongothers,br,hr,linkandmeta.
3.2.2.3RawTextElements
Thetermrawtextelementsreferstoelementswithinwhichthecontentistreatedasrawtextinsteadofmarkup.These
requirementsonlyapplytotheHTMLsyntax.InXHTML,allsuchelementsaretreatedasnormalelements.
Theserequireastarttagandanendtag.Neithertheselfclosingtagsyntax,noroptionaltagsaresupported.
Theseelementscanonlycontainrawtext.Thismeansthatothercontentlikecomments,characterreferencesandotherelements
cannotberepresentedintheHTMLsyntax.Thatis,themarkupforsuchconstructsistreatedastextinsteadofmarkup.All
occurrencesofspecialcharactersdonotneedtobeescapedascharacterreferences,astheyotherwisewouldwithinnormal
elements.
HTMLExample:
Ascriptelementcontainingsomefunctions.SpecialcharactersdonotneedtobeescapedusingcharacterreferencesoraCDATAsection.
<script>
functionisLeap(year){

returnyear%4==0&&year%100!=0||year%400==0;
}
functioncompare(a,b){

if(a<b)

return1;

elseif(a>b)

return1;

return0;
}
</script>

Thereis,however,oneadditionalrestrictionthatthetextcannotcontainastringthatlooksliketheelement'sendtag.Specifically,a
stringthatmatchesthepatternof"</"followedbyacaseinsensitivematchfortheelement'stagname,followedbyeither"/",">",or
whitespace.
ExampleError:
Ascriptelementcannotcontainastringthatisindistinguishablefromtheendtag.
<script>
if(condition){

document.write("<scriptsrc=\"example.js\"></script>");
}
</script>

Inthepreviousexample,anHTMLconformancecheckerwouldreporttheerrorasrelatingtothesecondendtag,believingthatthe
firstisinfacttheendtag.Caremustbetakentoensuresuchstringsdonotoccurwithinthescript.
HTMLExample:

Thejavascriptcanbemodifiedbyescapingtheslash,toworkaroundtheHTMLsyntaxerror.
<script>
if(condition){

document.write("<scriptsrc=\"example.js\"><\/script>");
}
</script>

InXHTML,becausesuchelementsaretreatedasnormalelements,markuplikecomments,characterreferencesandother
elementscanberepresented.Itisthereforenecessarytoescapeallspecialcharactersusingeithercharacterreferencesorby
enclosingthecontentwithinaCDATAsection.
XHTMLExample:
SpecialcharacterswithinascriptelementmaybeescapedusingcharacterreferencesintheXHTMLsyntax.
<script>
functionisLeap(year){

returnyear%4==0&amp;&amp;year%100!=0||year%400==0;
}
functioncompare(a,b){

if(a&lt;b)

return1;

elseif(a&gt;b)

return1;

return0;
}
</script>
XHTMLExample:
SpecialcharacterswithinascriptelementmaybeescapedusingaCDATAsectionintheXHTMLsyntax.
<script><![CDATA[
functionisLeap(year){

returnyear%4==0&&year%100!=0||year%400==0;
}
functioncompare(a,b){

if(a<b)

return1;

elseif(a>b)

return1;

return0;
}
]]></script>

TheabovedoesnotworkinHTMLbecausethestrings"<![CDATA["and"]]>"aretreatedastextinsteadofmarkup.However,by
takingadvantageofthescriptinglanguage'scommentsyntax,thosestringscanbecommentedsothattheyareignoredbythe
scriptinHTML,butstillprocessedasmarkupinXHTML.ThisprovidesuswithananHTMLandXHTMLcompatiblesyntaxfor
scripts.
Example:
TheHTMLandXHTMLcompatiblesyntaxforincludingjavascript.
<script>//<![CDATA[
functionisLeap(year){

returnyear%4==0&&year%100!=0||year%400==0;
}
functioncompare(a,b){

if(a<b)

return1;

elseif(a>b)

return1;

return0;
}
//]]></script>

3.2.2.4RCDATAElements
ThetermRCDATAelementsreferstoelementswithinwhichcharacterreferencesaresupported,butallothercontentistreatedas
rawtextinsteadofmarkup.TheserequirementsonlyapplytotheHTMLsyntax.InXHTML,allsuchelementsaretreatedasnormal
elements.
Theserequireastarttagandanendtag.Neithertheselfclosingtagsyntax,noroptionaltagsaresupported.
Theseelementscanonlycontaintextorcharacterreferences.Thismeansthatonlycharacterreferencesaretreatedasmarkup,
whereasallothercontentlikecommentsandotherelementscannotberepresentedintheHTMLsyntax.Thatis,themarkupfor
suchconstructsistreatedastext.
Occurrencesofspecialcharactersmay,butgenerallydonotneedtobeescapedascharacterreferences,astheyotherwisewould
withinnormalelements.Butthisissubjecttotheadditionalrestrictionthatthetextcannotincludeanambiguousampersand.Thatis,

anampersandfollowedasequenceofcharactersthatlookslikeanamedcharacterreference,butwhichisnotvalid.
HTMLExample:
Atextareaelementcancontaintextandcharacterreferences.
<textarea>
Thiscancontaincharacterreferenceslike&amp;,&lt;and&gt;,
butsuchcharactersandalsobewrittendirectlyas&,<and>.
Stringsthatlooklike<!comments>orotherelements<span>
aretreatedasplaintext,insteadofmarkup.
</textarea>
ExampleError:
Anambiguousampersandcannotoccurwithinatextareaelement.
<textarea>
Anunknownnamedcharacterreferencelike&this
givesanambiguousampersanderror.
</textarea>

Anotheradditionalrestrictionthatthetextcannotcontainastringthatlooksliketheelement'sendtag.Specifically,astringthat
matchesthepatternof"</"followedbyacaseinsensitivematchfortheelement'stagname,followedbyeither"/",">",or
whitespace.
ExampleError:
Atextareaelementcannotcontainastringthatisindistinguishablefromtheendtag.
<textarea>
Thistextcannotcontainastringlike</textareabecause
itlookslikeanendtagfortheelement.
</textarea>

InXHTML,becausesuchelementsaretreatedasnormalelements,markuplikecommentsandotherelementscanalsobe
represented.Itisthereforenecessarytoescapeallspecialcharactersusingeithercharacterreferencesorbyenclosingthecontent
withinaCDATAsection.
XHTMLExample:
AtextareaelementcancontaintextandcharacterreferencesandcommentsintheXHTMLsyntax.
<textarea>
Thiscancontaincharacterreferenceslike&amp;,&lt;and&gt;.
UnliketheHTMLsyntax,thiscanalsocontaincomments.
<!justlikeothernormalelements>
Ifthestringisintendedtoberendered,thespecialcharactersmustbeescaped
&lt;!likethis&gt;.
</textarea>
XHTMLExample:
ThecontentofatextareaelementcanalsobecontainedwithinaCDATAsection.
<textarea><![CDATA[Thiscancontainspecialcharacterslike&,<and>.
Stringsthatlooklikemarkup,like<!comments>,
characterreferences&amp;,&lt;and&gt;,
orotherelements<span>aretreatedasplaintext,insteadofmarkup.
]]></textarea>

3.2.2.5ForeignElements
ThetermforeignelementsreferstoelementsthatareintheSVGandMathMLnamespaces.
Theserequireastarttagandanendtag.Theselfclosingtagsyntaxmaybeused,wheretheelement'scontentmodelpermits.
Optionaltagsarenotsupported.
Theseelementscancontaintext,characterreferences,CDATAsections,otherelements,andcomments,butthetextmustnot
containthelessthansigncharacter(<)oranambiguousampersand.
Needexamples.
3.2.2.6NormalElements
NormalElementsreferstoallotherHTMLelementsthatarenotcategorisedinanyoftheothertypes.
Thesehaveastarttagandanendtag.Theseelementsdonotsupporttheselfclosingtagsyntax.Certainelementshaveoptional
tags,meaningthatoneorbothtagsmaybeomittedinspecificcircumstanceswherethepresenceofthetagwillbeimpliedby
surroundingmarkup.Consulttheelementdefinitionstoseewhichtagsmaybeomitted.

Normalelementscancontaintext,characterreferences,otherelements,andcomments,butthetextmustnotcontainthelessthan
signcharacter(<)oranambiguousampersand.Someadditionalrestrictionsapplyonaperelementbasistosomespecific
Self
HTML
XHTML
ElementType
StartTag
EndTag
AllowedContentSyntax
elements.Consulttheelementdefinitionsfordetails.
Closing
Needexamples.
3.2.2.7ElementTypeComparision
ComparisonoftheelementtypesyntaxrequirementsinHTML.(ThisdoesnotapplytoXHTML)
Self
ElementType
StartTag
EndTag
AllowedContentSyntax
Closing
Normal
Yes(sometimes
Yes(sometimes
No
Text,elements,comments,characterreferences
Element
optional)
optional)
No

Yes
(optional)

Empty

Yes(Required)

Yes(Required)

No

Text

Yes(Required)

Yes(Required)

No

Text,characterreferences

Yes

Yes

Yes

Text,elements,CDATAsections,comments,character
references

VoidElement Yes
RawText
Element
RCDATA
Element
Foreign
Element

3.2.2.8HTMLandXHTMLComparison
ComparisonoftheelementandtagsyntaxrequirementsbetweenHTMLandXHTML
HTML
XHTML
Optionalforselectedelementsrequiredforothers,
StartTag
Requiredforallelements
unlessanemptyelementtagisused
Optionalforselectedelementsforbiddenforvoid
Requiredforallelementswithmatchingstarttag,
EndTag
elementsorifemptyelementtagisusedrequiredfor
unnecessaryandforbiddenifemptyelementtagis
others
used
Allowedforvoidelementsandforeigncontentelements
SelfClosingTag
Allowedforallelements(ifcontentmodelpermits)
(ifcontentmodelpermits)
TagName
Caseinsensitive
Namespace
PrefixesforTag Forbidden
Name
NormalElements Yes
VoidElements
RawText
Elements
RCDATA
Elements
ForeignElements
Linefeed
immediatelyafter
starttag

Casesensitive
Allowed

Yes
Yes,usestarttagimmediatelyclosedbyanendtag,
Yes,usestarttagwithnoendtag,oremptyelementtag
oremptyelementtag
Yes

No(treatedasnormalelements)

Yes

No(treatedasnormalelements)

SVGandMathMLonly

Any

Normalised

Allowed

3.2.3Attributes
Elementsmayhaveattributesthatareusedtospecifyadditionalinformationaboutthem.Someattributesaredefinedgloballyand
canbeusedonanyHTMLelement,whileothersaredefinedforspecificelementsonly.Everyattributemusthaveanattribute
namethatisusedtoidentifyit.Everyattributealsohasanassociatedattributevalue,which,dependingontheattribute'sdefinition,
mayrepresentoneofseveraldifferenttypes.Thepermittedsyntaxforeachattributedependsonthegivenvalue.
AtypicalattributeinHTMLhasanameandavalueseparatedbyanequalssign(=).Attributesareplacedwithinastarttagandare
separatedfromthetagnameandfromeachotherbywhitespace.Theymustnotbespecifiedwithinanendtag.
Example:
Thesyntaxoftwotypicalattributes.
<divclass="example"lang="en">...</div>
ExampleError:
Attributescannotbeplacedwithinendtags.
<sectionid="example">...</sectionid="example">

InHTML,attributenamesarecaseinsensitive.Itisconventionaltousetheircanonicalcase,butthisisnotrequired.Forexample,
theycouldbewritteninalluppercaseormixedcase,dependingonyourownpreferences.Forcustomattributes,attributenames
mustconsistofoneormorecharactersotherthanthespacecharacters,controlcharacters,NULL,oneofthecharacters:double
quote("),singlequote('),greaterthansign(>),solidus(/),equalssign(=),noranycharactersthatarenotdefinedbyUnicode.Itis,
however,recommendedthatauthorsusethelowercaselettersintherangesazand09.
HTMLExample:
AttributenamesinHTMLarecaseinsensitive,andcanbewritteninuppercaseormixedcase.
<divCLASS="example"Lang="en">...</div>

InXHTML,attributenamesarecasesensitiveandmustbewrittenintheircanonicalcase.Ingeneral,thecanonicalcaseis
lowercaseformostattributesonHTMLandMathMLelements,andcamelcaseforSVG.Refertothedefinitionofeachelementifin
doubt.
Attributevaluesmaycontaintextandcharacterreferences,subjecttotherestrictionthatthetextcannotcontainanambiguous
ampersand,andtoanyadditionalrestrictionsimposedbythesyntaxbeingused.Therearefourslightlydifferentsyntaxesthatmay
beusedforattributesinHTML:empty,unquoted,singlequotedanddoublequoted.AllfoursyntaxesmaybeusedintheHTML
syntax,dependingonwhatisneededforeachspecificattribute.However,intheXHTMLsyntax,attributevaluesmustalwaysbe
quotedusingeithersingleordoublequotes.
3.2.3.1EmptyAttributeSyntax
Anemptyattributeisonewherethevaluehasbeenomitted.Thisisasyntacticshorthandforspecifyingtheattributewithanempty
value,andiscommonlyusedforbooleanattributes.ThissyntaxmaybeusedintheHTMLsyntax,butnotintheXHTMLsyntax.
Note:InpreviouseditionsofHTML,whichwereformallybasedonSGML,itwastechnicallyanattributesnamethatcouldbe
omittedwherethevaluewasauniqueenumeratedvaluespecifiedintheDTD.However,duetolegacyconstraints,thishasbeen
changedinHTML5toreflectthewayimplementationsreallywork.
HTMLExample:
EmptyattributesmayhavetheirvalueomittedintheHTMLsyntax.
<inputdisabled>...</div>
Example:
Specifyingthevalueasasanemptystringisequivalenttotheemptyattributesyntax.ThisisanXHTMLcompatiblesyntax.
<inputdisabled="">...</div>

Note:Thepreviousexamplesaresemanticallyequivalenttospecifyingtheattributewiththevalue"disabled",butarenotexactlythe
same.
Thissyntaxispermittedonlyforbooleanattributes.
3.2.3.2UnquotedAttributeValueSyntax
Anunquotedattributevalueisonewherethevalueissupplied,butisnotsurroundedbyquotationmarks.Thissyntaxmaybeused
intheHTMLsyntax,butnotintheXHTMLsyntax.
Theattributevaluemustnotcontainanyliteralspacecharacters,anyofthecharacters:doublequote("),apostrophe('),equals
sign(=),lessthansign(<),greaterthansign(>),orgraveaccent(`),andthevaluemustnotbetheemptystring.Torepresentthose
charactersinanattributevalue,theyeitherneedtobeescapedusingcharacterreferences,oryouneedtouseeitherthesingleor
doublequotedattributevalues.
HTMLExample:
SomeattributevaluesmaybeleftunquotedintheHTMLsyntax.
<imgsrc=example.pngheight=200width=300/>

Inthepreviousexample,eachattributeisseparatedfromthelastbyaspace.Theslashattheend,whichdespitenotbeing
separatedfromthelastvaluebyanyspacecharacters,isnotconsideredpartoftheattribute'svalue.Instead,thetheslashindicates
theuseoftheselfclosingtagsyntax.
Theremaybespacecharactersbetweentheattributenameandtheequalssign(=),andbetweenthatandtheattributevalue.
HTMLExample:
Whitespaceispermittedbeforeandafterthetheequalssign,separatingthenameandvalue.
<imgsrc=image.png>

3.2.3.3DoubleQuotedAttributeValueSyntax

Andoublequotedattributevalueisonewherethesuppliedvalueissurroundedbydoublequotationmarks(").Thissyntaxmaybe
usedinbothHTMLandXHTML.
HTML
XHTML
Theattributevaluemustdelimitedbydoublequotecharacters(")beforeandafterthevalue,andmustnotcontainanydoublequote
charactersoranambiguousampersandsinbetween.Allothertextandcharacterreferencesarepermitted.
Theadvantageofquotingattributes,thevaluemaycontaintheadditionalcharactersthatcantbeusedinunquotedattributevalues.
Toincludeadoublequotecharacterwithinthevalue,eitheruseacharacterreference(&quot;),oruseasinglequotedattributevalue
instead.
Example:
Attributevaluesmaybequotedwithdoublequotemarks.
<imgsrc="example.jpg"title="Anexamplephotograph">

Theremaybespacecharactersbetweentheattributenameandtheequalssign(=),andbetweenthatandtheattributevalue.
HTMLExample:
Whitespaceispermittedbeforeandafterthetheequalssign,separatingthenameandvalue.
<imgsrc="example.png">

3.2.3.4SingleQuotedAttributeValueSyntax
Ansinglequotedattributevalueisonewherethesuppliedvalueissurroundedbysinglequotationmarks(').Thissyntaxmaybe
usedinbothHTMLandXHTML.
Theattributevaluemustdelimitedbysinglequotecharacters(')beforeandafterthevalue,andmustnotcontainanysinglequote
charactersoranambiguousampersandsinbetween.Allothertextandcharacterreferencesarepermitted.
Theadvantageofquotingattributes,thevaluemaycontaintheadditionalcharactersthatcantbeusedinunquotedattributevalues.
Toincludeasinglequote(orapostrophe)characterwithinthevalue,eitheruseacharacterreference(&apos;),oruseadouble
quotedattributevalueinstead.
Example:
Attributevaluesmaybequotedwithsinglequotemarks.
<imgsrc='example.jpg'title='Anexamplephotograph'>

Theremaybespacecharactersbetweentheattributenameandtheequalssign(=),andbetweenthatandtheattributevalue.
HTMLExample:
Whitespaceispermittedbeforeandafterthetheequalssign,separatingthenameandvalue.
<imgsrc='example.png'>

3.2.3.5HTMLandXHTMLComparison
ComparisonoftheattributesyntaxrequirementsbetweenHTMLandXHTML
HTML
XHTML
AttributeNames
Caseinsensitive
Casesensitive
NamespacePrefixesforAttributeNames
Limited,specifiedprefixesonly
Allowed
Emptyattributes
Allowed
Forbidden
Unquotedattributes
Allowed
Forbidden
Doublequotedattributes
Allowed
Allowed
Singlequotedattributes
Linefeedsinattributevalues
3.2.4Comments
...
3.2.5Text
...
3.2.6CDATASections
...

Allowed
Allowed

Allowed
Normalisedtospaces

3.2.7CharacterReferences
Discussnumericandnamedcharacterreferencesyntax.Maylinktothelistofentityreferencesinaseparatedocument,ratherthan
tryingtolistthemallinhere.

3.3UnderstandingMIMETypes
Discusstext/html,application/xhtml+xml,etc.

3.4CharacterEncoding
OverviewofUnicode,characterrepertoires,encodings,etc.DeclaringtheencodingwiththeContentTypeheader,BOM,meta,etc.

3.5ChoosingHTMLorXHTML
ThechoiceofHTMLorXHTMLsyntaxislargelydependentuponanumberoffactorsthe,includingneedsofagivenproject,the
skillsetofthedevelopersinvolved,levelofsupportinbrowsersusedbythesitestargetaudience,oritmaysimplybeamatterof
personalpreference.
Theimportantthingtounderstandisthattherearevalidreasonstochooseboth,andthatauthorsareencouragedtomakean
informeddecision.
Needtodevelopguidelinestohelpauthorsmakethischoice.

3.6PolyglotDocuments
ApolyglotHTMLdocumentisadocumentthatconformstoboththeHTMLandXHTMLsyntacticrequirements,andwhichcanbe
processedaseitherbybrowsers,dependingontheMIMEtypeused.Thisworksbyusingacommonsubsetofthesyntaxthatis
sharedbybothHTMLandXHTML.
PolyglotdocumentsareusefultocreateforsituationswhereadocumentisintendedtobeservedaseitherHTMLorXHTML,
dependingonthesupportinparticularbrowsers,orwhenitisnotknownatthetimeofcreation,whichMIMEtypethedocumentwill
ultimatelybeservedas.
Inordertosuccessfullycreateandmaintainpolyglotdocuments,authorsneedtobefamiliarwithboththesimilaritiesand
differencesbetweenthetwosyntaxes.Thisincludesnotonlysyntacticdifferences,butalsodifferencesinthewaystylesheets,and
scriptsarehandled,andthewayinwhichcharacterencodingsaredetected.
Thissectionwillprovidethedetailsabouteachofthesesimilaritiesanddifferences,andprovideguidelinesonthecreationof
polyglotdocuments.
BasethisontheHTMLvs.XHTMLarticle.

4TheHTMLVocabularyandAPIs
4.1Categories
EachelementinHTMLfallsintozeroormorecategoriesthatgroupelementswithsimilarcharacteristicstogether.Thefollowing
categoriesareusedinthisguide:
Metadatacontent
Flowcontent
Sectioningroot
Sectioningcontent
Headingcontent
Phrasingcontent
Embeddedcontent
Interactivecontent
Transparent
Someelementshaveuniquerequirementsanddonotfitintoanyparticularcategory.
Thesecategoriesarerelatedasfollows:

Flow
Phrasing

Interactive

Heading

Embedded
Sectioning
Metadata

[Createandlinktosomesortofindexofelementsthatlistseachelementineachcategory.]
4.1.1MetadataContent
Metadatacontentincludeselementsformarkingupdocumentmetadatamarkinguporlinkingtoresourcesthatdescribethe
behaviourorpresentationofthedocumentorindicaterelationshipswithotherdocuments.
Metadataelementsappearwithintheheadofadocument.Somecommonexamplesofmetadataelementsinclude:title,meta,link,
scriptandstyle.
4.1.2Flowcontent
Mostelementsthatareusedinthebodyofdocumentsandapplicationsarecategorisedasflowcontent.Mostoftheelementsused
tomarkupthemaincontentinthebodyofapageareconsideredtobeflowcontent.Ingeneral,thisincludeselementsthatare
presentedvisuallyaseitherblocklevelorinlinelevel.
Somecommonflowcontentincludeselementslikediv,p,emandstrong.
Elementscategorisedasheadingcontent,phrasingcontentorembeddedcontentarealsoconsideredtobeflowcontent.
4.1.3Sectioningroot
[Thisdescriptionneedsimproving.]
Theseelementscanhavetheirownoutlines,butthesectionsandheadersinsidetheseelementsdonotcontributetotheoutlinesof
theirancestors.
Somecommonsectioningrootelementsinclude,amongothers,body,blockquoteandfigure.
4.1.4Sectioningcontent
Sectioningcontentisusedforstructuringadocumentintosections,eachofwhichgenerallyhasitsownheading.Theseelements
provideascopewithinwhichassociatedheaders,footersandcontactinformationapply.
Somecommonsectioningelementsinclude,amongothers,section,articleandnav.
Mostsectioningelements,withtheexceptionofthebodyelement,arealsoclassifiedasflowcontent.
4.1.5Headingcontent
Headingcontentincludestheelementsformarkingupheaders.Headings,inconjunctionwiththesectioningelements,areusedto
describethethestructureofthedocument.
Headingcontentincludestheheaderelementandtheh1toh6elements.
Elementscategorisedasheadingcontentareconsideredtobeflowcontent.
4.1.6Phrasingcontent
Phrasingcontentincludestextandtextlevelmarkup.ThisissimilartotheconceptofinlinelevelelementsinHTML4.01.Most
elementsthatarecategorisedasphrasingcontentcanonlycontainotherphrasingcontent.
Somecommonexamplesofphrasingcontentelementsincludeabbr,em,strongandspan
Elementscategorisedasphrasingcontentareconsideredtobeflowcontent.
4.1.7Embeddedcontent

Embeddedcontentincludeselementsthatloadexternalresourcesintothedocument.Suchexternalresourcesinclude,forexample,
images,videosandFlashbasedcontent.Someembeddedcontentelementsincludeimg,object,embedandvideo.
Elementscategorisedasembeddedcontentareconsideredtobephrasingcontent,andthusalsoconsideredtobeflowcontent.
4.1.8Interactivecontent
Interactiveelementsarethosethatallowtheusertointeractwithoractivateinsomeway.Dependingontheusersbrowserand
device,thiscouldbeperformedusinganykindofinputdevice,suchas,forexample,amouse,keyboard,touchscreenorvoice
input.
Somecommonexamplesofinteractivecontentincludea,audioandvideowhenusedwiththecontrolsattribute,andmostform
controlsusinginput.
4.1.9TransparentContentModels
Someelementshavetransparentcontentmodels,meaningthattheirallowedcontentdependsupontheparentelement.Theymay
containanycontentthattheirparentelementmaycontain,inadditiontoanyotherallowancesorexceptionsdescribedforthe
element.
Whentheelementhasnoparent,thenthecontentmodeldefaultstoflowcontent.

4.2GlobalAttributes
Tobecompleted.

4.3TheElements
Expectmajorchangestothissection.Eachoftheseneedslongerdescriptionsandtheelementsshouldbedividedinto
categories.TheIDLfortheDOMInterfacesislikelytobereplacedbysomethingalotmorereaderfriendlyinthefutureconsider
itaplaceholderfornow.Attributeswilllikelybeaccompaniedbybriefdescriptionswithinthesummarybox,inadditiontofuller
descriptionsandexamplesafterwards.
4.3.1TheRootElement
4.3.1.1Thehtmlelement

Starttag:optionalEndtag:optional

ThehtmlelementrepresentstherootofanHTMLdocument.
Categories:

None.

ContainedBy:

Astherootelementofadocument.
Whereverasubdocumentfragmentisallowedinacompounddocument.

ContentModel:

Aheadelementfollowedbyabodyelement.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

manifest

Thehtmlelementistherootelementofadocument.Everydocumentmustbeginwiththiselement,anditmustcontainboththehead
andbodyelements.
Itisconsideredgoodpracticetospecifytheprimarylanguageofthedocumentonthiselementusingthelangattribute.
HTMLExample:
<!DOCTYPEhtml>
<htmllang="en">
<head>
...
</head>
<body>
...
</body>
</html>

IntheHTMLsyntaxonly,boththestartandendtagsareoptional,andsoforconvenienceeithermaybeomitted,unlessyouwishto
specifyattributesonthiselement,inwhichcase,atleastthestarttagneedstobeincluded.
HTMLExample:

<!DOCTYPEhtml>
<head>
...
</head>
<body>
...
</body>

IntheXHTMLsyntax,thexmlnsattributeneedstobespecifiedonthiselementtodeclarethatitisintheHTMLnamespace.Youmay
useeitherthelangorxml:langattributetospecifythelanguage.
XHTMLExample:
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en">
<head>
...
</head>
<body>
...
</body>
</html>
manifest

Themanifestattributegivestheaddressofthedocumentsapplicationcachemanifest,ifthereisone.Iftheattributeis
present,theattributesvaluemustbeavalidURL.
Needtodescribeapplicationcachemanifests.
4.3.2DocumentMetadata
4.3.2.1Theheadelement

Starttag:optionalEndtag:optional

Theheadelementcollectsthedocumentsmetadata.
Categories:

None.

ContainedBy:

Asthefirstelementinanhtmlelement.

ContentModel:

Oneormoreelementsofmetadatacontent,ofwhichexactlyoneisatitleelement.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

Theheadelementisthecontainerforthedocumentsmetadata.Metadataisinformationaboutthedocumentitself,suchasit'stitle,
author.Scriptsandstylesheetsmayalsobeincludedwithintheheadelement.Everydocumentmusthaveaheadelement.
ThefollowingexamplesillustratethetypicalusageoftheheadelementinHTMLandXHTML.
HTMLExample
<!DOCTYPEhtml>
<html>
<head>
<title>Example</title>
</head>
<body>
<h1>Document</h1>
</body>
</html>

XHTMLExample
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example</title>
</head>
<body>
<h1>Document</h1>
</body>
</html>

4.3.2.2Thetitleelement

Starttag:requiredEndtag:required

Thetitleelementrepresentsthedocumentstitleorname,andshouldbemeaningfulevenwhenreadoutofcontext.
Categories:

Metadatacontent.

ContainedBy:

Inaheadelementcontainingnoothertitleelements.

ContentModel:

Text.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.2.3Thebaseelement

Starttag:requiredEndtag:empty

ThebaseelementisforspecifyingabaseURLagainstwhichrelativelinkswillberesolved,andthenameofthedefaulttargetfor
openinglinksandformsubmissions.
Categories:

Metadatacontent.

ContainedBy:

Inaheadelementcontainingnootherbaseelements.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLBaseElement:HTMLElement{
attributeDOMStringhref;
attributeDOMStringtarget;
};

href
target

4.3.2.4Thelinkelement

Starttag:requiredEndtag:empty

Thelinkisforlinkingtootherresources,suchasstylesheets,faviconsandsyndicationfeeds.
Categories:

Metadatacontent.

ContainedBy:

Wheremetadatacontentisexpected.
Inanoscriptelementthatisachildofaheadelement.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes
href
rel
media
hreflang
type
sizes

Also,thetitleattributehasspecialsemanticsonthis
element.

interfaceHTMLLinkElement:HTMLElement{
attributebooleandisabled;
attributeDOMStringhref;
attributeDOMStringrel;
readonlyattributeDOMTokenListrelList;
attributeDOMStringmedia;
attributeDOMStringhreflang;
attributeDOMStringtype;
attributeDOMStringsizes;
};

TheLinkStyleinterfacemustalsobeimplementedbythis
element,thestylingprocessingmodeldefineshow.[CSSOM]

4.3.2.5Themetaelement

Starttag:requiredEndtag:empty

Themetaelementisforprovidingvarioustypesofmetadata,suchastheapplicationnameorspecifyingthedocumentscharacter
encoding.
Categories:

Metadatacontent.

ContainedBy:

Ifthecharsetattributeispresent,oriftheelementisintheEncodingdeclarationstate:inahead
element.
Ifthehttpequivattributeispresent,andtheelementisnotintheEncodingdeclarationstate:inahead
element.
Ifthehttpequivattributeispresent,andtheelementisnotintheEncodingdeclarationstate:ina
noscriptelementthatisachildofaheadelement.
Ifthenameattributeispresent:wheremetadatacontentisexpected.

ContentModel:

Empty.

ATTRIBUTES
Globalattributes
name

DOMINTERFACE
interfaceHTMLMetaElement:HTMLElement{
attributeDOMStringcontent;

attributeDOMStringname;
attributeDOMStringhttpEquiv;
};

httpequiv
content
charset

4.3.2.6Thestyleelement

Starttag:requiredEndtag:required

Thestyleelementallowsauthorstoembedstylesheets,typicallyCSS,withintheirdocuments.
Categories:

Metadatacontent.
Ifthescopedattributeispresent:flowcontent.

ContainedBy:

Ifthescopedattributeisabsent:wheremetadatacontentisexpected.
Ifthescopedattributeisabsent:inanoscriptelementthatisachildofaheadelement.
Ifthescopedattributeispresent:whereflowcontentisexpected,butbeforeanyotherflowcontent
otherthanotherstyleelementsandinterelementwhitespace.

ContentModel:

Dependsonthevalueofthetypeattribute.

ATTRIBUTES

DOMINTERFACE

Globalattributes
media
type
scoped

Also,thetitleattributehasspecialsemanticsonthis
element.

interfaceHTMLStyleElement:HTMLElement{
attributebooleandisabled;
attributeDOMStringmedia;
attributeDOMStringtype;
attributebooleanscoped;
};

TheLinkStyleinterfacemustalsobeimplementedbythis
element,thestylingprocessingmodeldefineshow.[CSSOM]

4.3.3Scripting
4.3.3.1Thescriptelement

Starttag:requiredEndtag:required

Thescriptelementallowsauthorstoincludescripts,typicallyjavaScript,anddatablocksintheirdocuments.
Categories:

Metadatacontent.
Flowcontent.
Phrasingcontent.

ContainedBy:

Wheremetadatacontentisexpected.
Wherephrasingcontentisexpected.

ContentModel:

Ifthereisnosrcattribute,dependsonthevalueofthetypeattribute.
Ifthereisasrcattribute,theelementmustbeeitheremptyorcontainonlyscriptdocumentation.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLScriptElement:HTMLElement{
attributeDOMStringsrc;
attributebooleanasync;
attributebooleandefer;
attributeDOMStringtype;
attributeDOMStringcharset;
attributeDOMStringtext;
};

src
async
defer
type
charset

4.3.3.2Thenoscriptelement

Starttag:requiredEndtag:required

Thenoscriptelementisusedtoprovidealternativecontentforusersusingbrowsersthatdonotsupportscriptingorhaveit
disabled.
Categories:

Metadatacontent.
Flowcontent.
Phrasingcontent.

ContainedBy:

InaheadelementofanHTMLdocument,iftherearenoancestornoscriptelements.
WherephrasingcontentisexpectedinHTMLdocuments,iftherearenoancestornoscriptelements.

ContentModel:

Whenscriptingisdisabled,inaheadelement:inanyorder,zeroormorelinkelements,zeroormore
styleelements,andzeroormoremetaelements.
Whenscriptingisdisabled,notinaheadelement:transparent,buttheremustbenonoscriptelement
descendants.
Otherwise:textthatconformstotherequirementsgivenintheprose.
ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4Sections
4.3.4.1Thebodyelement

Starttag:optionalEndtag:optional

Thebodyelementrepresentsthemaincontentofthedocument.
Categories:

Sectioningroot.

ContainedBy:

Asthesecondelementinanhtmlelement.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLBodyElement:HTMLElement{
attributeFunctiononbeforeunload;
attributeFunctiononerror;
attributeFunctiononhashchange;
attributeFunctiononload;
attributeFunctiononmessage;
attributeFunctiononoffline;
attributeFunctionononline;
attributeFunctiononpopstate;
attributeFunctiononresize;
attributeFunctiononstorage;
attributeFunctiononunload;
};

onbeforeunload
onerror
onhashchange
onload
onmessage
onoffline
ononline
onpopstate
onresize
onstorage
onunload

4.3.4.2Thesectionelement

Starttag:requiredEndtag:required

Thesectionelementrepresentsagenericdocumentorapplicationsection.Asection,inthiscontext,isathematicgroupingof
content,typicallywithaheaderandpossiblyafooter.
Categories:

Flowcontent.
Sectioningcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.3Thenavelement

Starttag:requiredEndtag:required

Thenavelementrepresentsasectionofapagecontainingprimarynavigationlinkstootherpagesortopartswithinthepage.
Categories:

Flowcontent.
Sectioningcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.4Thearticleelement

Starttag:requiredEndtag:required

Thearticleelementrepresentsanindependentsectionofadocument,page,orsite.Thiscouldbeaforumpost,amagazineor
newspaperarticle,ablogentry,ausersubmittedcomment,oranyotherindependentitemofcontent.
Categories:

Flowcontent.
Sectioningcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.5Theasideelement

Starttag:requiredEndtag:required

Theasideelementrepresentsasectionofapagethatconsistsofcontentthatistangentiallyrelatedtothecontentaroundthe
asideelement,andwhichcouldbeconsideredseparatefromthatcontent.Suchsectionsareoftenrepresentedassidebarsin
printedtypography.
Categories:

Flowcontent.
Sectioningcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.6Theh1,h2,h3,h4,h5,andh6elements

Starttag:requiredEndtag:required

Theseelementsdefineheadersfortheirsections.
Categories:

Flowcontent.
Headingcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.7Theheaderelement

Starttag:requiredEndtag:required

Theheaderelementrepresentstheheaderofasection,typicallycontainingheadingsandsubheadings,andothermetadata
aboutthesection.
Categories:

Flowcontent.
Headingcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent,includingatleastonedescendantthatisheadingcontent,butnosectioningcontent
descendants,noheaderelementdescendants,andnofooterelementdescendants.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.8Thefooterelement

Starttag:requiredEndtag:required

Thefooterelementrepresentsafooterofasection,typicallycontaininginformationsuchaswhowroteit,linkstorelated
documents,andcopyrightnotices.

Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent,butwithnoheadingcontentdescendants,nosectioningcontentdescendants,andno
footerelementdescendants.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.9Theaddresselement

Starttag:requiredEndtag:required

Theaddresselementrepresentsthecontactinformationforthesectionitappliesto.Ifitappliestothebodyelement,thenit
insteadappliestothedocumentasawhole.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent,butwithnoheadingcontentdescendants,nosectioningcontentdescendants,no
footerelementdescendants,andnoaddresselementdescendants.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.4.10HeadingsandSections
Atypicaldocumentisoftenstructuredintodifferentsectionsandsubsections,witheachpotentiallyhavingitsownheadingand
possiblyasubheading.Theseheadingandsectioningelementsprovideawayforthisstructuretobeconveyedtothereader.
Considerasimplepagelikeablog,whichisstructuredintoafewmainsections.
4.3.5GroupingContent
4.3.5.1Thepelement

Starttag:requiredEndtag:optional

Thepelementrepresentsaparagraph.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.2Thehrelement

Starttag:requiredEndtag:empty

Thehrelementrepresentsaparagraphlevelthematicbreak,e.g.ascenechangeinastory,oratransitiontoanothertopicwithin
asectionofareferencebook.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.3Thebrelement
Thebrelementrepresentsalinebreak.

Starttag:requiredEndtag:empty

Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.4Thepreelement

Starttag:requiredEndtag:required

Thepreelementrepresentsablockofpreformattedtext,inwhichstructureisrepresentedbytypographicconventionsratherthan
byelements.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.5Thedialogelement

Starttag:requiredEndtag:required

Thedialogelementrepresentsaconversation.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Zeroormorepairsofonedtelementfollowedbyoneddelement.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.6Theblockquoteelement

Starttag:requiredEndtag:required

Theblockquoteelementrepresentsasectionthatisquotedfromanothersource.
Categories:

Flowcontent.
Sectioningroot.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLQuoteElement:HTMLElement{
attributeDOMStringcite;
};

cite

TheHTMLQuoteElementinterfaceisalsousedbytheqelement.

4.3.5.7Theolelement

Starttag:requiredEndtag:required

Theolelementrepresentsanorderedlist.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Zeroormorelielements.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLOListElement:HTMLElement{
attributebooleanreversed;
attributelongstart;
};

reversed
start

4.3.5.8Theulelement

Starttag:requiredEndtag:required

Theulelementrepresentsanunorderedlist.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Zeroormorelielements.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.9Thelielement

Starttag:requiredEndtag:optional

Thelielementrepresentsalistitem.
Categories:

None.

ContainedBy:

Insideolelements.
Insideulelements.
Insidemenuelements.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes
Iftheelementisachildofanolelement:value

interfaceHTMLLIElement:HTMLElement{
attributelongvalue;
};

4.3.5.10Thedlelement

Starttag:requiredEndtag:required

Thedlelementintroducesanassociationlistcontaininggroupsoftermsandassociateddescriptions.(adescriptionlist).
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Zeroormoregroupseachconsistingofoneormoredtelementsfollowedbyoneormoredd
elements.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.11Thedtelement

Starttag:requiredEndtag:optional

Thedtelementrepresentstheterm,orname,partofatermdescriptiongroupinadescriptionlist(dlelement),andthetalker,or
speaker,partofatalkerdiscoursepairinaconversation(dialogelement).
Categories:

None.

ContainedBy:

Beforeddordtelementsinsidedlelements.
Beforeaddelementinsideadialogelement.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.5.12Theddelement

Starttag:requiredEndtag:optional

Theddelementrepresentsthedescription,definition,orvalue,partofatermdescriptiongroupinadescriptionlist(dlelement),
andthediscourse,orquote,partinaconversation(dialogelement).
Categories:

None.

ContainedBy:

Afterdtorddelementsinsidedlelements.
Afteradtelementinsideadialogelement.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6TextLevelSemantics
4.3.6.1Theaelement

Starttag:requiredEndtag:required

Iftheaelementhasanhrefattribute,thenitrepresentsahyperlink.
Categories:

Interactivecontent.
Flowcontent.
Whentheelementonlycontainsphrasingcontent:phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Transparent,buttheremustbenointeractivecontentdescendant.

ATTRIBUTES

DOMINTERFACE

Globalattributes

[Stringifies=href]interfaceHTMLAnchorElement:HTMLElement{
attributeDOMStringhref;
attributeDOMStringtarget;
attributeDOMStringping;
attributeDOMStringrel;
readonlyattributeDOMTokenListrelList;
attributeDOMStringmedia;
attributeDOMStringhreflang;
attributeDOMStringtype;
};

href
target
ping
rel
media
hreflang
type

TheCommandinterfacemustalsobeimplementedbythiselement.

4.3.6.2Theqelement

Starttag:requiredEndtag:required

Theqelementrepresentsaphrasequotedfromanothersource.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

TheqelementusestheHTMLQuoteElementinterface.

cite

4.3.6.3Theciteelement

Starttag:requiredEndtag:required

Theciteelementrepresentsthetitleofawork,suchasanarticle,abook,apoem,asong,afilm,oranyothercreativework.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.4Theemelement

Starttag:requiredEndtag:required

Theemelementrepresentsstressemphasisofitscontents.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.5Thestrongelement

Starttag:requiredEndtag:required

Thestrongelementrepresentsstrongimportanceforitscontents.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.6Thesmallelement

Starttag:requiredEndtag:required

Thesmallelementrepresentssmallprint(partofadocumentoftendescribinglegalrestrictions,suchascopyrightsorother
disadvantages),orothersidecomments.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.7Themarkelement

Starttag:requiredEndtag:required

Themarkelementrepresentsarunoftextinonedocumentmarkedorhighlightedforreferencepurposes,duetoitsrelevancein
anothercontext.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.8Thedfnelement

Starttag:requiredEndtag:required

Thedfnelementrepresentsthedefininginstanceofaterm,whereitsdefinitionisprovidednearby.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent,buttheremustbenodescendantdfnelements.

ATTRIBUTES

DOMINTERFACE

Globalattributes
Also,thetitleattributehasspecialsemanticsonthis
element.

UsesHTMLElement.

4.3.6.9Theabbrelement

Starttag:requiredEndtag:required

Theabbrelementrepresentsanabbreviationoracronym,optionallywithitsexpansion.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes
Also,thetitleattributehasspecialsemanticsonthis
element.

UsesHTMLElement.

4.3.6.10Thetimeelement

Starttag:requiredEndtag:required

Thetimeelementrepresentsadateand/oratime.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLTimeElement:HTMLElement{
attributeDOMStringdateTime;
readonlyattributeDatedate;
readonlyattributeDatetime;
readonlyattributeDatetimezone;
};

datetime

4.3.6.11Theprogresselement

Starttag:requiredEndtag:required

Theprogresselementrepresentsthecompletionprogressofatask.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES
Globalattributes
value
max

DOMINTERFACE
interfaceHTMLProgressElement:HTMLElement{
attributefloatvalue;
attributefloatmax;

readonlyattributefloatposition;
};

4.3.6.12Themeterelement

Starttag:requiredEndtag:required

Themeterelementrepresentsascalarmeasurementwithinaknownrange,orafractionalvalue.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLMeterElement:HTMLElement{
attributefloatvalue;
attributefloatmin;
attributefloatmax;
attributefloatlow;
attributefloathigh;
attributefloatoptimum;
};

value
min
low
high
max
optimum

4.3.6.13Thecodeelement

Starttag:requiredEndtag:required

Thecodeelementrepresentsafragmentofcomputercode.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.14Thevarelement

Starttag:requiredEndtag:required

Thevarelementrepresentsavariable,suchasinamathematicalexpressionorprogrammingcontext,oritcouldjustbeaterm
usedasaplaceholderinprose.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.15Thesampelement

Starttag:requiredEndtag:required

Thesampelementrepresents(sample)outputfromaprogramorcomputingsystem.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.16Thekbdelement

Starttag:requiredEndtag:required

Thekbdelementrepresentsuserinput(typicallykeyboardinput,althoughitmayalsobeusedtorepresentotherinput,suchas
voicecommands).
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.17Thesubandsupelements

Starttag:requiredEndtag:required

Thesupelementrepresentsasuperscriptandthesubelementrepresentsasubscript.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.18Thespanelement

Starttag:requiredEndtag:required

Thespanelementdoesntmeananythingonitsown,butcanbeusefulwhenusedtogetherwithotherattributes,e.g.class,lang,
ordir.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.19Theielement

Starttag:requiredEndtag:required

Theielementrepresentsaspanoftextinanalternatevoiceormood,orotherwiseoffsetfromthenormalprose,suchasa
taxonomicdesignation,atechnicalterm,anidiomaticphrasefromanotherlanguage,athought,ashipname,orsomeother
prosewhosetypicaltypographicpresentationisitalicized.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.20Thebelement
Starttag:requiredEndtag:required

Thebelementrepresentsaspanoftexttobestylisticallyoffsetfromthenormalprosewithoutconveyinganyextraimportance,
suchaskeywordsinadocumentabstract,productnamesinareview,orotherspansoftextwhosetypicaltypographic
presentationisboldened.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.21Thebdoelement

Starttag:requiredEndtag:required

ThebdoelementallowsauthorstooverridetheUnicodebidialgorithmbyexplicitlyspecifyingadirectionoverride.[BIDI]
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes
Also,thedirglobalattributehasspecialsemanticsonthis
element.

UsesHTMLElement.

4.3.6.22Therubyelement

Starttag:requiredEndtag:required

Therubyelementallowsoneormorespansofphrasingcontenttobemarkedwithrubyannotations.Rubyannotationsareshort
runsoftextpresentedalongsidebasetext,primarilyusedinEastAsiantypographyasaguideforpronounciationortoinclude
otherannotations.InJapanese,thisformoftypographyisalsoknownasfurigana.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Oneormoregroupsof:phrasingcontentfollowedeitherbyasinglertelement,oranrpelement,an
rtelement,andanotherrpelement.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.23Thertelement

Starttag:requiredEndtag:required

Thertelementmarkstherubytextcomponentofarubyannotation.
Categories:

None.

ContainedBy:

Asachildofarubyelement.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.6.24Therpelement

Starttag:requiredEndtag:required

Therpelementcanbeusedtoprovideparenthesesaroundarubytextcomponentofarubyannotation,tobeshownbyuser
agentsthatdontsupportrubyannotations.

Categories:

None.

ContainedBy:

Asachildofarubyelement,eitherimmediatelybeforeorimmediatelyafteranrtelement.

ContentModel:

Iftherpelementisimmediatelyafteranrtelementthatisimmediatelyprecededbyanotherrp
element:asinglecharacterfromUnicodecharacterclassPe.
Otherwise:asinglecharacterfromUnicodecharacterclassPs.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.7Edits
4.3.7.1Theinselement

Starttag:requiredEndtag:required

Theinselementrepresentsanadditiontothedocument.
Categories:

Flowcontent.
Whentheelementonlycontainsphrasingcontent:phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Transparent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsestheHTMLModElementinterface.

cite
datetime

4.3.7.2Thedelelement

Starttag:requiredEndtag:required

Thedelelementrepresentsaremovalfromthedocument.
Categories:

Flowcontent.
Whentheelementonlycontainsphrasingcontent:phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Transparent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsestheHTMLModElementinterface.

cite
datetime

4.3.8EmbeddedContent
4.3.8.1Thefigureelement

Starttag:requiredEndtag:required

Thefigureelementrepresentssomeflowcontent,optionallywithacaption,whichcanbemovedawayfromthemainflowofthe
documentwithoutaffectingthedocumentsmeaning.
Categories:

Flowcontent.
Sectioningroot.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Either:onelegendelementfollowedbyflowcontent.
Or:Flowcontentfollowedbyonelegendelement.
Or:Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.8.2Theimgelement

Starttag:requiredEndtag:empty

Animgelementrepresentsanimage.
Categories:

Flowcontent.
Phrasingcontent.
Embeddedcontent.
Iftheelementhasanusemapattribute:Interactivecontent.

ContainedBy:

Whereembeddedcontentisexpected.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

[NamedConstructor=Image(),
NamedConstructor=Image(inunsignedlongwidth),
NamedConstructor=Image(inunsignedlongwidth,inunsignedlongheight)]
interfaceHTMLImageElement:HTMLElement{
attributeDOMStringalt;
attributeDOMStringsrc;
attributeDOMStringuseMap;
attributebooleanisMap;
attributeunsignedlongwidth;
attributeunsignedlongheight;
readonlyattributebooleancomplete;
};

alt
src
usemap
ismap
width
height

4.3.8.3Theiframeelement

Starttag:requiredEndtag:required

Theiframeelementintroducesanewnestedbrowsingcontext.
Categories:

Flowcontent.
Phrasingcontent.
Embeddedcontent.

ContainedBy:

Whereembeddedcontentisexpected.

ContentModel:

Textthatconformstotherequirementsgivenintheprose.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLIFrameElement:HTMLElement{
attributeDOMStringsrc;
attributeDOMStringname;
attributeDOMStringsandbox;
attributebooleanseamless;
attributeDOMStringwidth;
attributeDOMStringheight;
};

src
name
sandbox
seamless
width
height

ObjectsimplementingtheHTMLIFrameElementinterfacemust
alsoimplementtheEmbeddingElementinterfacedefinedinthe
WindowObjectspecification.[WINDOW]

4.3.8.4Theembedelement

Starttag:requiredEndtag:empty

Theembedelementrepresentsanintegrationpointforanexternal(typicallynonHTML)applicationorinteractivecontent.
Categories:

Flowcontent.
Phrasingcontent.
Embeddedcontent.

ContainedBy:

Whereembeddedcontentisexpected.

ContentModel:

Empty.

ATTRIBUTES
Globalattributes
src
type
width

DOMINTERFACE
interfaceHTMLEmbedElement:HTMLElement{
attributeDOMStringsrc;
attributeDOMStringtype;
attributeDOMStringwidth;

height

Anyotherattributethathasnonamespace(seeprose).

attributeDOMStringheight;
};

Dependingonthetypeofcontentinstantiatedbytheembed
element,thenodemayalsosupportotherinterfaces.

4.3.8.5Theobjectelement

Starttag:requiredEndtag:required

Theobjectelementcanrepresentanexternalresource,which,dependingonthetypeoftheresource,willeitherbetreatedasan
image,asanestedbrowsingcontext,orasanexternalresourcetobeprocessedbyaplugin.
Categories:

Flowcontent.
Phrasingcontent.
Embeddedcontent.
Listed,submittable,formassociatedelement.

ContainedBy:

Whereembeddedcontentisexpected.

ContentModel:

Zeroormoreparamelements,then,transparent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLObjectElement:HTMLElement{
attributeDOMStringdata;
attributeDOMStringtype;
attributeDOMStringname;
attributeDOMStringuseMap;
readonlyattributeHTMLFormElementform;
attributeDOMStringwidth;
attributeDOMStringheight;
};

data
type
name
usemap
form
width
height

ObjectsimplementingtheHTMLObjectElementinterfacemust
alsoimplementtheEmbeddingElementinterfacedefinedinthe
WindowObjectspecification.[WINDOW]
Dependingonthetypeofcontentinstantiatedbytheobject
element,thenodemayalsosupportotherinterfaces.

4.3.8.6Theparamelement

Starttag:requiredEndtag:empty

Theparamelementdefinesparametersforpluginsinvokedbyobjectelements.
Categories:

None.

ContainedBy:

Asachildofanobjectelement,beforeanyflowcontent.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLParamElement:HTMLElement{
attributeDOMStringname;
attributeDOMStringvalue;
};

name
value

4.3.8.7Thevideoelement

Starttag:requiredEndtag:required

Avideoelementrepresentsavideoormovie.
Categories:

Flowcontent.
Phrasingcontent.
Embeddedcontent.
Iftheelementhasacontrolsattribute:Interactivecontent.

ContainedBy:

Whereembeddedcontentisexpected.

ContentModel:

Iftheelementhasasrcattribute:transparent.
Iftheelementdoesnothaveasrcattribute:oneormoresourceelements,then,transparent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLVideoElement:HTMLMediaElement{
attributeDOMStringwidth;
attributeDOMStringheight;
readonlyattributeunsignedlongvideoWidth;
readonlyattributeunsignedlongvideoHeight;
attributeDOMStringposter;
};

src
poster
autobuffer
autoplay
loop
controls
width
height

4.3.8.8Theaudioelement

Starttag:requiredEndtag:required

Anaudioelementrepresentsasoundoraudiostream.
Categories:

Flowcontent.
Phrasingcontent.
Embeddedcontent.
Iftheelementhasacontrolsattribute:Interactivecontent.

ContainedBy:

Whereembeddedcontentisexpected.

ContentModel:

Iftheelementhasasrcattribute:transparent.
Iftheelementdoesnothaveasrcattribute:oneormoresourceelements,then,transparent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

[NamedConstructor=Audio(),
NamedConstructor=Audio(inDOMStringsrc)]
interfaceHTMLAudioElement:HTMLMediaElement{
//nomembers
};

src
autobuffer
autoplay
loop
controls

4.3.8.9Thesourceelement

Starttag:requiredEndtag:empty

Thesourceelementallowsauthorstospecifymultiplemediaresourcesformediaelements.
Categories:

None.

ContainedBy:

Asachildofamediaelement,beforeanyflowcontent.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLSourceElement:HTMLElement{
attributeDOMStringsrc;
attributeDOMStringtype;
attributeDOMStringmedia;
};

src
type
media

4.3.8.10Thecanvaselement

Starttag:requiredEndtag:required

Thecanvaselementrepresentsaresolutiondependentbitmapcanvas,whichcanbeusedforrenderinggraphs,gamegraphics,
orothervisualimagesonthefly.
Categories:

Flowcontent.
Phrasingcontent.
Embeddedcontent.

ContainedBy:

Whereembeddedcontentisexpected.

ContentModel:

Transparent.

ATTRIBUTES
Globalattributes
width
height

DOMINTERFACE
interfaceHTMLCanvasElement:HTMLElement{
attributeunsignedlongwidth;
attributeunsignedlongheight;

DOMStringtoDataURL([Optional]inDOMStringtype,[Variadic]inanyargs);
ObjectgetContext(inDOMStringcontextId);
};

4.3.8.11Themapelement

Starttag:requiredEndtag:required

Themapelement,inconjunctionwithanyareaelementdescendants,definesanimagemap.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLMapElement:HTMLElement{
attributeDOMStringname;
readonlyattributeHTMLCollectionareas;
readonlyattributeHTMLCollectionimages;
};

name

4.3.8.12Theareaelement

Starttag:requiredEndtag:empty

Theareaelementrepresentseitherahyperlinkwithsometextandacorrespondingareaonanimagemap,oradeadareaonan
imagemap.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected,butonlyifthereisamapelementancestor.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLAreaElement:HTMLElement{
attributeDOMStringalt;
attributeDOMStringcoords;
attributeDOMStringshape;
attributeDOMStringhref;
attributeDOMStringtarget;
attributeDOMStringping;
attributeDOMStringrel;
readonlyattributeDOMTokenListrelList;
attributeDOMStringmedia;
attributeDOMStringhreflang;
attributeDOMStringtype;
};

alt
coords
shape
href
target
ping
rel
media
hreflang
type

4.3.9TabularData
4.3.9.1Thetableelement

Starttag:requiredEndtag:required

Thetableelementrepresentsdatawithmorethanonedimension(atable).
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Inthisorder:optionallyacaptionelement,followedbyeitherzeroormorecolgroupelements,followed
optionallybyatheadelement,followedoptionallybyatfootelement,followedbyeitherzeroormore
tbodyelementsoroneormoretrelements,followedoptionallybyatfootelement(buttherecanonly
beonetfootelementchildintotal).

ATTRIBUTES
Globalattributes

DOMINTERFACE
interfaceHTMLTableElement:HTMLElement{
attributeHTMLTableCaptionElementcaption;
HTMLElementcreateCaption();
voiddeleteCaption();

attributeHTMLTableSectionElementtHead;
HTMLElementcreateTHead();
voiddeleteTHead();
attributeHTMLTableSectionElementtFoot;
HTMLElementcreateTFoot();
voiddeleteTFoot();
readonlyattributeHTMLCollectiontBodies;
HTMLElementcreateTBody();
readonlyattributeHTMLCollectionrows;
HTMLElementinsertRow([Optional]inlongindex);
voiddeleteRow(inlongindex);
};

4.3.9.2Thecaptionelement

Starttag:requiredEndtag:required

Thecaptionelementrepresentsthetitleofthetablethatisitsparent,ifithasaparentandthatisatableelement.
Categories:

None.

ContainedBy:

Asthefirstelementchildofatableelement.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.3.9.3Thecolgroupelement

Starttag:optionalEndtag:optional

Thecolgroupelementrepresentsagroupofoneormorecolumnsinthetablethatisitsparent,ifithasaparentandthatisa
tableelement.
Categories:

None.

ContainedBy:

Asachildofatableelement,afteranycaptionelementsandbeforeanythead,tbody,tfoot,andtr
elements.

ContentModel:

Zeroormorecolelements.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLTableColElement:HTMLElement{
attributeunsignedlongspan;
};

span

4.3.9.4Thecolelement

Starttag:requiredEndtag:empty

Ifacolelementhasaparentandthatisacolgroupelementthatitselfhasaparentthatisatableelement,thenthecolelement
representsoneormorecolumnsinthecolumngrouprepresentedbythatcolgroup.
Categories:

None.

ContainedBy:

Asachildofacolgroupelementthatdoesn'thaveaspanattribute.

ContentModel:

Empty.

ATTRIBUTES

DOMINTERFACE

Globalattributes

HTMLTableColElement,sameasforcolgroupelements.This
interfacedefinesonemember,span.

span

4.3.9.5Thetbodyelement

Starttag:optionalEndtag:optional

Thetbodyelementrepresentsablockofrowsthatconsistofabodyofdatafortheparenttableelement,ifthetbodyelementhas
aparentanditisatable.
Categories:

None.

ContainedBy:

Asachildofatableelement,afteranycaption,colgroup,andtheadelements,butonlyifthereareno
trelementsthatarechildrenofthetableelement.

ContentModel:

Zeroormoretrelements

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLTableSectionElement:HTMLElement{
readonlyattributeHTMLCollectionrows;
HTMLElementinsertRow([Optional]inlongindex);
voiddeleteRow(inlongindex);
};

TheHTMLTableSectionElementinterfaceisalsousedforthead
andtfootelements.

4.3.9.6Thetheadelement

Starttag:optionalEndtag:optional

Thetheadelementrepresentstheblockofrowsthatconsistofthecolumnlabels(headers)fortheparenttableelement,ifthe
theadelementhasaparentanditisatable.
Categories:

None.

ContainedBy:

Asachildofatableelement,afteranycaption,andcolgroupelementsandbeforeanytbody,tfoot,
andtrelements,butonlyiftherearenoothertheadelementsthatarechildrenofthetableelement.

ContentModel:

Zeroormoretrelements

ATTRIBUTES

DOMINTERFACE

Globalattributes

HTMLTableSectionElement,asdefinedfortbodyelements.

4.3.9.7Thetfootelement

Starttag:optionalEndtag:optional

Thetfootelementrepresentstheblockofrowsthatconsistofthecolumnsummaries(footers)fortheparenttableelement,ifthe
tfootelementhasaparentanditisatable.
Categories:

None.

ContainedBy:

Asachildofatableelement,afteranycaption,colgroup,andtheadelementsandbeforeanytbody
andtrelements,butonlyiftherearenoothertfootelementsthatarechildrenofthetableelement.
Asachildofatableelement,afteranycaption,colgroup,thead,tbody,andtrelements,butonlyif
therearenoothertfootelementsthatarechildrenofthetableelement.

ContentModel:

Zeroormoretrelements

ATTRIBUTES

DOMINTERFACE

Globalattributes

HTMLTableSectionElement,asdefinedfortbodyelements.

4.3.9.8Thetrelement

Starttag:requiredEndtag:optional

Thetrelementrepresentsarowofcellsinatable.
Categories:

None.

ContainedBy:

Asachildofatheadelement.
Asachildofatbodyelement.
Asachildofatfootelement.
Asachildofatableelement,afteranycaption,colgroup,andtheadelements,butonlyifthereareno
tbodyelementsthatarechildrenofthetableelement.

ContentModel:

Zeroormoretdorthelements

ATTRIBUTES
Globalattributes

DOMINTERFACE
interfaceHTMLTableRowElement:HTMLElement{
readonlyattributelongrowIndex;
readonlyattributelongsectionRowIndex;
readonlyattributeHTMLCollectioncells;
HTMLElementinsertCell([Optional]inlongindex);
voiddeleteCell(inlongindex);
};

4.3.9.9Thetdelement

Starttag:requiredEndtag:optional

Thetdelementrepresentsadatacellinatable.
Categories:

Sectioningroot.

ContainedBy:

Asachildofatrelement.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLTableDataCellElement:HTMLTableCellElement{};

colspan
rowspan
headers

4.3.9.10Thethelement

Starttag:requiredEndtag:optional

Thethelementrepresentsaheadercellinatable.
Categories:

None.

ContainedBy:

Asachildofatrelement.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLTableHeaderCellElement:HTMLTableCellElement{
attributeDOMStringscope;
};

colspan
rowspan
headers
scope

4.3.10Forms
4.3.10.1Theformelement

Starttag:requiredEndtag:required

Theformelementrepresentsacollectionofformassociatedelements,someofwhichcanrepresenteditablevaluesthatcanbe
submittedtoaserverforprocessing.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent,butwithnoformelementdescendants.

ATTRIBUTES
Globalattributes
acceptcharset
action
autocomplete
enctype
method
name
novalidate
target

DOMINTERFACE
[Callable=namedItem]
interfaceHTMLFormElement:HTMLElement{
attributeDOMStringacceptCharset;
attributeDOMStringaction;
attributebooleanautocomplete;
attributeDOMStringenctype;
attributeDOMStringmethod;
attributeDOMStringname;
attributebooleannovalidate;
attributeDOMStringtarget;
readonlyattributeHTMLFormControlsCollectionelements;
readonlyattributelonglength;
[IndexGetter]anyitem(inDOMStringname);
[NameGetter=OverrideBuiltins]anynamedItem(inDOMStringname);
voidsubmit();
voidreset();
booleancheckValidity();
voiddispatchFormInput();
voiddispatchFormChange();
};

4.3.10.2Thefieldsetelement

Starttag:requiredEndtag:required

Thefieldsetelementrepresentsasetofformcontrolsgroupedunderacommonname.
Categories:

Flowcontent.
Listedformassociatedelement.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Onelegendelementfollwedbyflowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLFieldSetElement:HTMLElement{
attributebooleandisabled;
readonlyattributeHTMLFormElementform;
attributeDOMStringname;

disabled
form
name

readonlyattributeDOMStringtype;
readonlyattributeHTMLFormControlsCollectionelements;
readonlyattributebooleanwillValidate;
readonlyattributeValidityStatevalidity;
readonlyattributeDOMStringvalidationMessage;
booleancheckValidity();
voidsetCustomValidity(inDOMStringerror);
};

4.3.10.3Thelabelelement

Starttag:requiredEndtag:required

Thelabelrepresentsacaptioninauserinterface.Thecaptioncanbeassociatedwithaspecificformcontrol,knownasthelabel
elementslabeledcontrol.
Categories:

Flowcontent.
Phrasingcontent.
Interactivecontent.
Formassociatedelement.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent,butwithnodescendantlabelableformassociatedelementsunlessitisthe
element'slabeledcontrol,andnodescendantlabelelements.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLLabelElement:HTMLElement{
readonlyattributeHTMLFormElementform;
attributeDOMStringhtmlFor;
readonlyattributeHTMLElementcontrol;
};

form
for

4.3.10.4Theinputelement

Starttag:requiredEndtag:empty

Theinputelementrepresentsatypeddatafield,usuallywithaformcontroltoallowtheusertoeditthedata.
Categories:

Flowcontent.
Phrasingcontent.
IfthetypeattributeisnotintheHiddenstate:Interactivecontent.
Listed,labelable,submittable,andresettableformassociatedelement.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Empty.

ATTRIBUTES
Globalattributes
accept
action
alt
autocomplete
autofocus

DOMINTERFACE
interfaceHTMLInputElement:HTMLElement{
attributeDOMStringaccept;
attributeDOMStringaction;
attributeDOMStringalt;
attributebooleanautocomplete;
attributebooleanautofocus;
attributebooleandefaultChecked;
attributebooleanchecked;

attributebooleandisabled;
attributeDOMStringenctype;
readonlyattributeHTMLFormElementform;
attributeDOMStringheight;
attributebooleanindeterminate;
readonlyattributeHTMLElementlist;
attributeDOMStringmax;
attributelongmaxLength;
attributeDOMStringmethod;
attributeDOMStringmin;
attributebooleanmultiple;
attributeDOMStringname;
attributebooleannoValidate;
attributeDOMStringpattern;
attributeDOMStringplaceholder;
attributebooleanreadOnly;
attributebooleanrequired;
attributeunsignedlongsize;
attributeDOMStringsrc;
attributeDOMStringstep;
attributeDOMStringtarget;
attributeDOMStringtype;
attributeDOMStringdefaultValue;
attributeDOMStringvalue;
attributeDatevalueAsDate;
attributefloatvalueAsNumber;
readonlyattributeHTMLOptionElementselectedOption;
attributeDOMStringwidth;

checked
disabled
enctype
form
height
list
max
maxlength
method
min
multiple
name
novalidate
pattern
placeholder
readonly
required
size
src
step
target

voidstepUp(inlongn);
voidstepDown(inlongn);

type
value

readonlyattributebooleanwillValidate;
readonlyattributeValidityStatevalidity;
readonlyattributeDOMStringvalidationMessage;
booleancheckValidity();
voidsetCustomValidity(inDOMStringerror);

width

readonlyattributeNodeListlabels;
voidselect();
attributeunsignedlongselectionStart;
attributeunsignedlongselectionEnd;
voidsetSelectionRange(inunsignedlongstart,inunsignedlongend);
};

4.3.10.5Thebuttonelement

Starttag:requiredEndtag:required

Thebuttonelementrepresentsabutton.Iftheelementisnotdisabled,thentheuseragentshouldallowtheusertoactivatethe
button.
Categories:

Flowcontent.
Phrasingcontent.
Interactivecontent.
Listed,labelable,andsubmittableformassociatedelement.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent,buttheremustbenointeractivecontentdescendant.

ATTRIBUTES
Globalattributes
action
autofocus
disabled
enctype
form
method
name
novalidate
target
type
value

DOMINTERFACE
interfaceHTMLButtonElement:HTMLElement{
attributeDOMStringaction;
attributebooleanautofocus;
attributebooleandisabled;
attributeDOMStringenctype;
readonlyattributeHTMLFormElementform;
attributeDOMStringmethod;
attributeDOMStringname;
attributeDOMStringnoValidate;
attributeDOMStringtarget;
attributeDOMStringtype;
attributeDOMStringvalue;
readonlyattributebooleanwillValidate;
readonlyattributeValidityStatevalidity;
readonlyattributeDOMStringvalidationMessage;
booleancheckValidity();
voidsetCustomValidity(inDOMStringerror);
readonlyattributeNodeListlabels;
};

4.3.10.6Theselectelement

Starttag:requiredEndtag:required

Theselectelementrepresentsacontrolforselectingamongstasetofoptions.
Categories:

Flowcontent.
Phrasingcontent.
Interactivecontent.
Listed,labelable,submittable,andresettableformassociatedelement.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Zeroormoreoptionoroptgroupelements.

ATTRIBUTES

DOMINTERFACE

Globalattributes

[Callable=namedItem]
interfaceHTMLSelectElement:HTMLElement{
attributebooleanautofocus;
attributebooleandisabled;
readonlyattributeHTMLFormElementform;
attributebooleanmultiple;
attributeDOMStringname;
attributebooleansize;

autofocus
disabled
form
multiple
name
size

readonlyattributeDOMStringtype;
readonlyattributeHTMLOptionsCollectionoptions;
attributeunsignedlonglength;
[IndexGetter]anyitem(inDOMStringname);
[NameGetter]anynamedItem(inDOMStringname);
voidadd(inHTMLElementelement,inHTMLElementbefore);
voidadd(inHTMLElementelement,inlongbefore);
voidremove(inlongindex);
readonlyattributeHTMLCollectionselectedOptions;
attributelongselectedIndex;
attributeDOMStringvalue;
readonlyattributebooleanwillValidate;
readonlyattributeValidityStatevalidity;
readonlyattributeDOMStringvalidationMessage;
booleancheckValidity();
voidsetCustomValidity(inDOMStringerror);
readonlyattributeNodeListlabels;
};

4.3.10.7Thedatalistelement

Starttag:requiredEndtag:required

Thedatalistelementrepresentsasetofoptionelementsthatrepresentpredefinedoptionsforothercontrols.Thecontentsofthe
elementrepresentsfallbackcontentforlegacyuseragents,intermixedwithoptionelementsthatrepresentthepredefined
options.Intherendering,thedatalistelementrepresentsnothingandit,alongwithitschildren,shouldbehidden.
Categories:

Flowcontent.
Phrasingcontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Either:phrasingcontent.
Or:Zeroormoreoptionelements.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLDataListElement:HTMLElement{
readonlyattributeHTMLCollectionoptions;
};

4.3.10.8Theoptgroupelement
Theoptgroupelementrepresentsagroupofoptionelementswithacommonlabel.
Categories:

None.

ContainedBy:

Asachildofaselectelement.

ContentModel:

Zeroormoreoptionelements.

Starttag:requiredEndtag:optional

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLOptGroupElement:HTMLElement{
attributebooleandisabled;
attributeDOMStringlabel;
};

disabled
label

4.3.10.9Theoptionelement

Starttag:requiredEndtag:optional

Theoptionelementrepresentsanoptioninaselectelementoraspartofalistofsuggestionsinadatalistelement.
Categories:

None.

ContainedBy:

Asachildofaselectelement.
Asachildofadatalistelement.
Asachildofanoptgroupelement.

ContentModel:

Text.

ATTRIBUTES

DOMINTERFACE

Global
attributes
disabled
label
selected
value

[NamedConstructor=Option(),
NamedConstructor=Option(inDOMStringtext),
NamedConstructor=Option(inDOMStringtext,inDOMStringvalue),
NamedConstructor=Option(inDOMStringtext,inDOMStringvalue,inbooleandefaultSelected),
NamedConstructor=Option(inDOMStringtext,inDOMStringvalue,inbooleandefaultSelected,inbooleanselected)]
interfaceHTMLOptionElement:HTMLElement{
attributebooleandisabled;
readonlyattributeHTMLFormElementform;
attributeDOMStringlabel;
attributebooleandefaultSelected;
attributebooleanselected;
attributeDOMStringvalue;
readonlyattributeDOMStringtext;
readonlyattributelongindex;
};

4.3.10.10Thetextareaelement

Starttag:requiredEndtag:required

Thetextareaelementrepresentsamultilineplaintexteditcontrolfortheelementsrawvalue.Thecontentsofthecontrol
representthecontrolsdefaultvalue.
Categories:

Flowcontent.
Phrasingcontent.
Interactivecontent.
Listed,labelable,submittable,andresettableformassociatedelement.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Text.

ATTRIBUTES
Globalattributes
autofocus
cols
disabled
form
maxlength
name
readonly
required
rows
wrap

DOMINTERFACE
interfaceHTMLTextAreaElement:HTMLElement{
attributebooleanautofocus;
attributeunsignedlongcols;
attributebooleandisabled;
readonlyattributeHTMLFormElementform;
attributelongmaxLength;
attributeDOMStringname;
attributebooleanreadOnly;
attributebooleanrequired;
attributeunsignedlongrows;
attributeDOMStringwrap;
readonlyattributeDOMStringtype;
attributeDOMStringdefaultValue;
attributeDOMStringvalue;
readonlyattributebooleanwillValidate;
readonlyattributeValidityStatevalidity;
readonlyattributeDOMStringvalidationMessage;
booleancheckValidity();
voidsetCustomValidity(inDOMStringerror);
readonlyattributeNodeListlabels;
voidselect();

attributeunsignedlongselectionStart;
attributeunsignedlongselectionEnd;
voidsetSelectionRange(inunsignedlongstart,inunsignedlongend);
};

4.3.10.11Theoutputelement

Starttag:requiredEndtag:required

Theoutputelementrepresentstheresultofacalculation.
Categories:

Flowcontent.
Phrasingcontent.
Listedandresettableformassociatedelement.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLOutputElement:HTMLElement{
attributeDOMStringhtmlFor;
readonlyattributeHTMLFormElementform;
attributeDOMStringname;

for
form
name

readonlyattributeDOMStringtype;
attributeDOMStringdefaultValue;
attributeDOMStringvalue;
readonlyattributebooleanwillValidate;
readonlyattributeValidityStatevalidity;
readonlyattributeDOMStringvalidationMessage;
booleancheckValidity();
voidsetCustomValidity(inDOMStringerror);
};

4.3.11InteractiveElements
4.3.11.1Thedetailselement

Starttag:requiredEndtag:required

Thedetailselementrepresentsadditionalinformationorcontrolswhichtheusercanobtainondemand.
Categories:

Flowcontent.
Interactivecontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Onelegendelementfollowedbyflowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLDetailsElement:HTMLElement{
attributebooleanopen;
};

open

4.3.11.2Thecommandelement

Starttag:requiredEndtag:empty

Thecommandelementrepresentsacommandthattheusercaninvoke.
Categories:

Metadatacontent.
Flowcontent.
Phrasingcontent.

ContainedBy:

Wheremetadatacontentisexpected.
Wherephrasingcontentisexpected.

ContentModel:

Empty.

ATTRIBUTES
Globalattributes
type
label

DOMINTERFACE
interfaceHTMLCommandElement:HTMLElement{
attributeDOMStringtype;
attributeDOMStringlabel;
attributeDOMStringicon;

attributebooleandisabled;
attributebooleanchecked;
attributeDOMStringradiogroup;
attributebooleandefault;
voidclick();//shadowsHTMLElement.click()
};

icon
disabled
checked
radiogroup
default

Also,thetitleattributehasspecialsemanticsonthis
element.

TheCommandinterfacemustalsobeimplementedbythis
element.

4.3.11.3Thebbelement

Starttag:requiredEndtag:required

Thebbelementrepresentsauseragentcommandthattheusercaninvoke.
Categories:

Flowcontent.
Phrasingcontent.
Interactivecontent.

ContainedBy:

Wherephrasingcontentisexpected.

ContentModel:

Phrasingcontent,buttheremustbenointeractivecontentdescendant.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLBrowserButtonElement:HTMLElement{
attributeDOMStringtype;
readonlyattributebooleansupported;
readonlyattributebooleandisabled;
};

type

TheCommandinterfacemustalsobeimplementedbythis
element.

4.3.11.4Themenuelement

Starttag:requiredEndtag:required

Themenuelementrepresentsalistofcommands.
Categories:

Flowcontent.
Iftheelement'stypeattributeisinthetoolbarstate:Interactivecontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Either:Zeroormorelielements.
Or:Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

interfaceHTMLMenuElement:HTMLElement{
attributeDOMStringtype;
attributeDOMStringlabel;
};

type
label

4.3.12MiscellaneousElements
4.3.12.1Thelegendelement

Starttag:requiredEndtag:required

Thelegendelementrepresentsatitleorexplanatorycaptionfortherestofthecontentsofthelegendelementsparentelement.
Categories:

None.

ContainedBy:

Asthefirstchildofafieldsetelement.
Asthefirstchildofadetailselement.
Asachildofafigureelement,iftherearenootherlegendelementchildrenofthatelement.

ContentModel:

Phrasingcontent.

ATTRIBUTES
Globalattributes

DOMINTERFACE
interfaceHTMLLegendElement:HTMLElement{
readonlyattributeHTMLFormElementform;
};

Element StartTag EndTag


4.3.12.2Thedivelement

ShortDescription

Notes
Starttag:requiredEndtag:required

Thedivelementrepresentsnothingatall.Itcanbeusedwiththeclass,lang/xml:lang,andtitleattributestomarkupsemantics
commontoagroupofconsecutiveelements.
Categories:

Flowcontent.

ContainedBy:

Whereflowcontentisexpected.

ContentModel:

Flowcontent.

ATTRIBUTES

DOMINTERFACE

Globalattributes

UsesHTMLElement.

4.4Microdata
...

5IndexofElements
5.1ConformingElements
Element StartTag EndTag
ShortDescription
a
required required Hyperlink
abbr

required required Abbreviation

address
area

required required Contactinformation


required empty Imagemapregion

article

required required Independentsection

aside

required required Auxiliarysection

audio

required required Audiostream

b
base

required required Boldtext


required empty DocumentbaseURI

bb

required required Browserbutton

bdo

required required Bidirectionaltextoverride

blockquote

required required Longquotation

body
br

optional optional Maincontent


required empty Linebreak

button

required required Pushbuttoncontrol

canvas

required required Bitmapcanvas

caption
cite

required required Tablecaption


required required Citation

code

required required Codefragment

col

required empty

colgroup

required optional Tablecolumngroup

command
datagrid

required empty Commandthatausercaninvoke


required required Interactivetree,listortabulardata

datalist

required required Predefinedcontrolvalues

dd

required optional Descriptiondescription

del

required required Deletion

details
dfn

required required Additionalinformation


required required Defininginstanceofaterm

dialog

required required Conversation

div

required required Genericdivision

dl

required required Descriptionlist

dt
em

required optional Descriptionterm


required required Stressemphasis

embed

required empty

fieldset

required required Formcontrolgroup

figure

required required Afigurewithacaption.

footer

required required Sectionfooter

Tablecolumn

Embeddedapplication

Notes

Element StartTag EndTag


form
required required Form

ShortDescription

h1

required required Headinglevel1

h2

required required Headinglevel2

h3

required required Headinglevel3

h4
h5

required required Headinglevel4


required required Headinglevel5

h6

required required Headinglevel6

head

optional optional Documenthead

header

required required Sectionheader

hr
html

required empty Separator


optional optional Documentroot

required required Italictext

iframe

required required Inlineframe

img

required empty

input
ins

required empty Formcontrol


required required Insertion

kbd

required required Userinput

label

required required Formcontrollabel

legend
li

required required Explanatorytitleorcaption


required optional Listitem

link

required empty

map

required required Clientsideimagemap

mark

required required Markedorhighlightedtext

menu
meta

required required Commandmenu


required empty Metadata

meter

required required Scalarmeasurement

nav

required required Navigation

noscript

required required Alternativecontentfornoscriptsupport

object
ol

required required Genericembeddedresource


required required Orderedlist

optgroup

required optional Optiongroup

option

required optional Selectionchoice

output

required required Outputcontrol

p
param

required optional Paragraph


required empty Pluginparameter

pre

required required Preformattedtext

progress

required required Progressofatask

required required Inlinequotation

rp
rt

required required Rubyparenthesis


required required Rubytext

ruby

required required Rubyannotation

samp

required required Sampleoutput

script

required required Linkedorembeddedscript

section
select

required required Documentsection


required required Selectioncontrol

small

required required Smallprint

source

required empty

span

required required Genericinlinecontainer

strong
style

required required Strongimportance


required required Embeddedstylesheet

sub

required required Subscript

sup

required required Superscript

table

required required Table

tbody
td

optional optional Tablebody


required optional Tablecell

textarea

required required Multilinetextcontrol

tfoot

optional optional Tablefooter

Image

Linktoresources

Mediaresource

Notes
Theheadinglevelisalsoaffectedbysectioningelements

Start
Short ShortDescription
Element
Element
StartTag
EndTag
HTML4.01/XHTML1.0
HTML5
Element
EndTag
Tag
Description
th
required optional Tableheadercell
thead

optional optional Tablehead

time

required required Dateand/ortime

title
tr

required required Documenttitle


required optional Tablerow

ul

required required Unorderedlist

var

required required Variable

video

required required Videoormovie

ShortDescription
Notes
Notes

5.2ObsoleteElements
Theseelementsareobsoleteandshouldnotbeusedbyauthors.However,theyaredocumentedherebecausetheyaresupported
bybrowsers,alongwithnotesaboutconformingalternativesthatmaybeusedinstead.
Thislistmaybeincomplete.Pleasereportanymissingelements.

acronym

Start
Short
EndTag
Tag
Description
required required Acronym
Usetheabbrelement

applet

required required Javaapplet

basefont

required empty

bgsound

required empty

Usetheaudioelement.

big

required required

UseasemanticallyappropriateelementwithCSSforstyle.

blink

required required

CSSprovidesanalternativewithlimitedbrowsersupport,butnotethatblinkingtextis
annoying.

center

required required

UseasemanticallyappropriateelementwithCSSforstyle.

dir
font

required required
required required Fontstyle

Usetheulelement.
UseasemanticallyappropriateelementwithCSSforstyle.

frame

required required

ConsiderusingCSSlayoutsortheiframeelement.

frameset

required required

ConsiderusingCSSlayoutsortheiframeelement.

isindex

required required

Useaformwithatextinputandsubmitbutton.

listing

required required

marquee
nobr

required required
required required

noembed

required required

noframes

required required

plaintext

required required

required required

spacer

required required

strike

required required

tt

required required Teletype

Considerusingthecodeelement,ifappropriate,oranothersemanticallyappropriate
elementwithCSSforstyle.

required required

UseasemanticallyappropriateelementwithCSSforstyle.

wbr

required empty

xmp

required required

Element

Basefont
style

Notes

Usetheobjectelement.
Thishaslimitedsupportinbrowsers.UseCSSinstead.

Preformatted
Usethepreelement.
text
ScriptingorCSSanimationscanbeusedtosimulatescrollingtext.
UseasemanticallyappropriateelementwithCSSforstyle.

Preformatted
Usethepreelement.
text
Considerusingthedelelement,ifappropriate,oranothersemanticallyappropriate
elementwithCSSforstyle.
UseCSSlayouttechniques.
Considerusingthedelelement,ifappropriate,oranothersemanticallyappropriate
elementwithCSSforstyle.

Preformatted
Usethepreelement.
text

5.3ComparisonofHTML4.01andHTML5Elements
a

Element
strict

HTML4.01/XHTML1.0

HTML5
yes

Hyperlink

ShortDescription

abbr
acronym

strict
strict

yes

Abbreviation
Acronym

address

strict

yes

Contactinformation

applet

transitional

Javaapplet

area

strict

yes

Imagemapregion

Element

HTML4.01/XHTML1.0

article

HTML5
yes

ShortDescription

aside

yes

Auxiliarysection

audio

yes

Audiostream

b
base

strict
strict

yes
yes

Boldtext
DocumentbaseURI

basefont

transitional

Basefontstyle

bb

yes

Browserbutton

bdo

strict

yes

Bidirectionaltextoverride

bgsound
big

strict

blink

blockquote

strict

yes

Longquotation

body

strict

yes

Maincontent

br
button

strict
strict

yes
yes

Linebreak
Pushbuttoncontrol

canvas

yes

Bitmapcanvas

caption

strict

yes

Tablecaption

center

transitional

cite
code

strict
strict

yes
yes

Citation
Codefragment

col

strict

yes

Tablecolumn

colgroup

strict

yes

Tablecolumngroup

command

yes

Commandthatausercaninvoke

datagrid
datalist

yes
yes

Interactivetree,listortabulardata
Predefinedcontrolvalues

dd

strict

yes

Descriptiondescription

del

strict

yes

Deletion

details

yes

Additionalinformation

dfn
dialog

strict

yes
yes

Defininginstanceofaterm
Conversation

dir

transitional

div

strict

yes

Genericdivision

dl

strict

yes

Descriptionlist

dt
em

strict
strict

yes
yes

Descriptionterm
Stressemphasis

embed

yes

Embeddedapplication

fieldset

strict

yes

Formcontrolgroup

figure

yes

Afigurewithacaption.

font
footer

transitional

yes

Fontstyle
Sectionfooter

form

strict

yes

Form

frame

frameset

frameset

frameset

h1
h2

strict
strict

yes
yes

Headinglevel1
Headinglevel2

h3

strict

yes

Headinglevel3

h4

strict

yes

Headinglevel4

h5

strict

yes

Headinglevel5

h6
head

strict
strict

yes
yes

Headinglevel6
Documenthead

header

yes

Sectionheader

hr

strict

yes

Separator

html

strict

yes

Documentroot

i
iframe

strict
transitional

yes
yes

Italictext
Inlineframe

img

strict

yes

Image

input

strict

yes

Formcontrol

Independentsection

Element

HTML4.01/XHTML1.0

ins

strict

HTML5
yes

ShortDescription

isindex

transitional

kbd

strict

yes

Userinput

label
legend

strict
strict

yes
yes

Formcontrollabel
Explanatorytitleorcaption

li

strict

yes

Listitem

link

strict

yes

Linktoresources

listing

Preformattedtext

map
mark

strict

yes
yes

Clientsideimagemap
Markedorhighlightedtext

marquee

menu

transitional

yes

Commandmenu

meta

strict

yes

Metadata

meter
nav

yes
yes

Scalarmeasurement
Navigation

nobr

noembed

noframes

frameset

noscript
object

strict
strict

yes
yes

Alternativecontentfornoscriptsupport
Genericembeddedresource

ol

strict

yes

Orderedlist

optgroup

strict

yes

Optiongroup

option

strict

yes

Selectionchoice

output
p

strict

yes
yes

Outputcontrol
Paragraph

param

strict

yes

Pluginparameter

plaintext

Preformattedtext

pre

strict

yes

Preformattedtext

progress
q

strict

yes
yes

Progressofatask
Inlinequotation

rp

yes

Rubyparenthesis

rt

yes

Rubytext

ruby

yes

Rubyannotation

s
samp

transitional
strict

yes

Sampleoutput

script

strict

yes

Linkedorembeddedscript

section

yes

Documentsection

select

strict

yes

Selectioncontrol

small
source

strict

yes
yes

Smallprint
Mediaresource

spacer

span

strict

yes

Genericinlinecontainer

strike
strong

transitional
strict

yes

Strongimportance

style

strict

yes

Embeddedstylesheet

sub

strict

yes

Subscript

sup

strict

yes

Superscript

table
tbody

strict
strict

yes
yes

Table
Tablebody

td

strict

yes

Tablecell

textarea

strict

yes

Multilinetextcontrol

tfoot

strict

yes

Tablefooter

th
thead

strict
strict

yes
yes

Tableheadercell
Tablehead

time

yes

Dateand/ortime

title

strict

yes

Documenttitle

tr

strict

yes

Tablerow

Insertion

Element
u

HTML4.01/XHTML1.0
transitional

HTML5

ShortDescription

ul

strict

yes

Unorderedlist

var

strict

yes

Variable

video

yes

Videoormovie

wbr

xmp

Preformattedtext

6HowtoReadThisGuide
Thissectionneedsmajorrevisionandmaybedropped.

6.1Conventions
Toeasereadabilityandimproveunderstanding,thisdocumentusesanumberofconventions.
6.1.1Notes,TipsandWarnings
Notesareusedthroughoutthisdocumenttoprovideadditionalinformation.Tipsareusedtoprovideusefulhintsandsuggestions.
Warningsareusedtopointoutcommonauthoringerrorsandhighlightimportantissuestobeawareof.
[Needtoprovideexamplesofthese]
6.1.2ExampleMarkup
ExamplemarkupisprovidedforbothHTMLandXHTML.Insomecases,themarkupisthesameandthusonlyoneexampleis
needed,butinotherstheremaybedifferencessyntacticdifferences.WhereHTMLandXHTMLdiffer,separateexamplesaregiven
witheachoneclearlylabelled.
HTMLExample:
<!DOCTYPEhtml>
<htmllang="en">
<head>
<title>HTMLExample</title>
</head>
<body>
<p>ThisisasampleHTMLdocument.
</body>
</html>

XHTMLExample:
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en">
<head>
<title>XHTMLExample</title>
</head>
<body>
<p>ThisisasampleXHTMLdocument.</p>
</body>
</html>

Sometimes,erroneousexamplesareincluded.Thisisusuallydonetoillustratecommonauthoringerrors,badpracticesandother
issuestobecautiousof.
ErroneousExample:
<p>Thismarkupcontainsa<em><strong>mistake</em></strong></p>

6.1.2.1Attributes
Unlessexplicitlystatedotherwiseforaspecificpurpose,allattributevaluesinexamplesarequotedusingdoublequotes.InHTML
examples,booleanattributesarewrittenintheirminimisedformandinXHTMLexamples,theyarewritteninexpandedform.
HTMLExample:
<inputtype="checkbox"checked>

XHTMLExample:
<inputtype="checkbox"checked="checked"/>

6.1.2.2VoidElements
InXHTMLexamples,duetotheXMLWellFormednessrequirements,voidelementsarealwaysmarkedupusingthetrailingslash.

XHTMLExample:
<imgsrc="image.png"alt="example"/>

InHTML,however,thetrailingslashisoptionaland,unlessexplicitlystatedotherwise,isalwaysomitted.
HTMLExample:
<imgsrc="image.png"alt="example">

6.1.2.3Namespaces
SomeXHTMLexamplesmakeuseofXMLnamespaces.Insuchcases,thefollowingprefixesareassumedtobedefinedevenif
thereisnoxmlnsattributesinthefragmentofcode.
xml
http://www.w3.org/XML/1998/namespace
html
http://www.w3.org/1999/xhtml
math
http://www.w3.org/1998/Math/MathML
svg
http://www.w3.org/2000/svg

XHTMLExample:
<htmlxml:lang="en">
...
</html>

XHTMLExample:
<div>
<svg:svg><svg:circler="50"cx="50"cy="50"fill="green"/></svg:svg>
</div>

You might also like