Monday 28 April 2014

Using Floating technique

we can use floating and it does not need position defined for the main content see the following example. Also it is most popular way in positioning:

#mainContent{
Padding:15px;
Margin: 15px auto;
Width:720px;
Border 1px Solid black;
Background-Color:#eef;
}

#first{
Float:left;
Padding:15px;
Width:330px;
}

#second{
Float:left
Padding:15px;
Width:330px;

}

after applying floating the main content like background color might not continue for that usually you use an empty P tag with the following class:
.clear {
    clear: both;
    height: 0;
    margin: 0;
    padding: 0;
}

No comments:

Post a Comment