Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmaya nelson
300 Pointswhat purpose does the exclamation mark before DOCTYPE fill?
yeeha.
or is it just there for emphasis/cosmetic purposes?
2 Answers
Michael Fish
7,804 PointsThe beginning of the tag ( <! ) has been around since SGML which was the basis of HTML. In HTML5 it doesn't have any deeper meaning other than letting the browser know it is standard HTML5.
ellie adam
26,377 PointsIn SGML, which is what HTML was nominally based on, up to and including HTML 4.01, the exclamation mark is part of the construct <!, which is the reference concrete syntax for mdo, markup declaration open. Markup declarations are not markup elements but, informally speaking, declarations relating to elements. This includes document type declaration, comment declarations, and entity declarations.
In HTML5, the HTML syntax has been defined very much in an ad hoc manner, and the doctype string is called just the doctype string β it has no role and no meaning beyond the expected effect of triggering βstandards modeβ (or βno-quirks modeβ) in browsers. In the XHTML syntax, it has its XML meaning.