DIV is very necessary tag in Modern HTML, which are used to create and structure a HTML document or layout. DIV tag defines a section in HTML document and they are defines a generic block-level container, which means that they have no additional formatting method. We can manage DIV with the CSS. Please follow the example below.
HTML Code:
<div class="main"> <div class="header">Heading Goes Here</div> <div class="content">Content1</div> <div class="content">Content2</div> <div class="content">Content3</div> <div class="footer">Footer Content</div> </div>
CSS Code:
.main
{
width:390px;
}
.header
{
width:380px;
background-color:#ffffcd;
text-align:center;
height:45px;
line-height:45px;
font-weight:bold;
padding:5px;
}
.content
{
float:left;
background-color:#fecccb;
padding:5px;
height:126px;
width:120px;
}
.footer
{
width:380px;
background-color:#cdffcc;
text-align:center;
height:55px;
line-height:55px;
padding:5px;
clear:both;
}
Browser view: