Tuesday 10 June 2014

HTML DIV Tag

The HTML <div> tag is used for defining a section of your document. With the div tag, you can group large sections of HTML elements together and format them with CSS. The difference between the div tag and the span tag is that the div tag is used with block-level elements whilst the span tag is used with inline elements.

<div style="background-color:orange;text-align:center">
  <p>Navigation section</p>
</div>
<div style="border:1px solid black;text-align:right ">
  <p>Content section</p>
</div>

Attribute:-


Attributes
Value
Description
left
right
center
justify
Specifies the alignment of the content inside a <div> element