DECLARE HEADING AND PARAGRAPH LAYOUT ELEMENTS

After you have a rough layout for your web page, you can start adding in some actual content. This is done using the same tags used in previous versions of HTML: the heading and paragraph elements:

<h1>Heading</h1><p>Paragraph text</p>...<h2>Subheading</h2><p>Paragraph text</p>...<h3>Sub-subheading</h3><p>Paragraph text</p>...

HTML5 does add in one new heading group semantic layout element, called <hgroup>. This enables you to group multiple heading elements together that immediately follow one another in descending order:

<hgroup>
   <h1>heading</h1>
   <h2>subheading</h2>
 </hgroup>
 <p>paragraph text</p>
 ...

You can use the heading group to alter the default margin spacing on the grouped headings, ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.