DIV Tutorial

  • The div tag defines a division or a section in an HTML document.
  • The div tag is used to group block-elements to format them with styles.

Example 1

Input

<div style="width:450px; vertical-align:middle margin:0 auto; height:100px; text-align:center; clear:both; border:solid 2px #666666;"> </div>

Output

Example 2

Input

<div style="width:450px; vertical-align:middle margin:0 auto; height:100px; text-align:center; border:solid 2px #666666;">
<div style="width:200px; vertical-align:middle; float:left; height:90px; text-align:center; border:solid 2px #666666; margin:3px 3px 3px 3px;">
Left Div</div>
<div style="width:200px; vertical-align:middle; float:right; height:90px; text-align:center; border:solid 2px #666666; margin:3px 3px 3px 3px;">
Right Div</div>

</div>

Output

Left Div
Right Div
 



 

Latest Tutorial


Most Visited Tutorial