<div> for structures

<div> is used to apply the style by using CSS.

 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
        <style> 
        .divClass { 
            background:grey; 
            color:white; 
            border: thin solid black; 
            padding: 0.2em; 
        } 
        </style> 
    </head> 
    <body> 
        <div class="divClass"> 
            <p>This is one paragraph.</p> 
            <p>This is another <i>paragraph</i>.</p> 
        </div> 
        <p><strong>Warning:</strong> This paragraph is outside the div element.</p> 
    </body> 
</html>
  
Click to view this demo.
Home 
  HTML CSS Book 
    HTML  

Related: