<section>

Description

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

Example


<!DOCTYPE HTML> 
<html> 
<head> 
<style> 
section{ <!--   w w w  . j  a  v a2  s  .  co  m-->
   background: grey; 
   color: white; 
   font-size: 1em; 
   margin-top: 0px;
} 
</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> 
    </section> 
</body> 
</html> 

Click to view the demo

The code above generates the following result.

section




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference