<section> marks sections

The section element is new to HTML5 and marks a section of a document.

 
<!DOCTYPE HTML> 
<html> 
<head> 
<title>Example</title> 
<style> 
section { background: grey; color: white; } 
</style> 
</head> 
<body> 
    <section> 
        <hgroup> 
            <h1>H1</h1> 
            <h2>H2</h2> 
        </hgroup> 
        <section> 
            <h1>H1 of section</h1> 
            <p>This is a paragraph.</p>
            <section> 
                <h1>H1 in sub section</h1> 
                <p>This is a paragraph.</p>
            </section> 
        </section> 
    </section> 
    <h1>H1 outside section</h1> 
    <p>This is a pargraph.</p> 
    <h2>H2</h2> 
</body> 
</html>
  
Click to view this demo.
Home 
  HTML CSS Book 
    HTML  

Related: