In fact, this does not require any special style, this is the default css property.
Two divs will always be side by side until the total width of the two divs is greater than the div of the container or you explicitly used clear: both; with the first div. Here is an example:
#outerdiv {
width:500px;
height:300px;
}
#innerdiv1 {
width:200px;
height:300px;
float:left;
}
#innerdiv2 {
width:300px;
height:300px;
}
If you have not specified any borders, they will be displayed side by side, but if you have specified borders / indents / margins, etc., you should adjust the width of the inner div accordingly.
source
share