<div>

Description

The <div> element stands for division and is used to segregate a group of elements.

Example


<html>
<body>
     <div style="background-color: #CCFFCC; border: 1px none #000000;">
          <p>This div element contains only text.</p>
     </div>
</body><!--from   w  w  w.j a va  2  s  . c om-->
</html>

Click to view the demo

The code above generates the following result.

div




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference