Syntax of HTML Heading Tags
Rules for coding heading elements in HTML 5
<body> ... flow content expected ... <hn>... phrasing content ...</hn> ... flow content expected ... <hgroup> <hn>... phrasing content ...</hn> </hgroup> ... </body>
- Inside an element where flow content is allowed, code one or more optional HTML heading (hn) elements.
- Begin each heading element with a starting <hn> tag with a number between 1 and 6 following the letter
h
. Theh
in the element name is lower case and the element name should be in the HTML namespace, which it will pick up automatically from thexmlns
attribute on the <html> tag. - Include any HTML global attributes on the heading tag as appropriate.
- End the heading element with a matching
</hn>
closing tag. - Inside the heading element, code the appropriate flow content.
<aside> Content Model
Content of the <aside> Tag
The inner HTML of HTML heading elements is restricted to HTML comments, text content and only the tags that are allowed in phrasing content: