Friday 23 August 2013

Division Using DIV Tag

<div> is known as division in html document. It is a paired tag which means if it open it needs to be close like this:

<div> Content goes here </div>

In contrast <meta />, <link />, <img />, <br /> and <hr /> which are of course standalone( empty tags ).

Divs are just like an empty vessels where you can put many different elements inside it this is what make it so special. Gone are the days when web designers use <table> to make page layout now it all done through <div> tags. Div is the block level element what it means that it takes up space before its presence and after its presence, and also left to right.

For instance:
<div>
    <p>
        Hello world hi how are you all. Hello world hi how are you all.
    </p>
</div>

I filled the "DIV" tag using <p> element.

More block level elements are <p>, <h1 to h6>, <nav> etc. In contrast there is also inline level elements like <span>, <a> which we will explore later.

No comments:

Post a Comment