HTML - Tags - <div>

#40 of 147
div
Next dl
Prev dir

 <html>
 <body>
     <div style="border: 1pt solid green; border-radius: 10px; padding: 1em">
         <p>
             Paragraph 1
         </p>
         <p>
             Paragraph 1
         </p>
     </div>
 </body>
 </html>
 

The div element is a block level container for child elements.

Short for division, the div element is used to improve code readability by adding structure, and to create a container that can be more easily styled with CSS.

A live example:


Paragraph 1

Paragraph 2


N of

Ads by Google


Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath