Approach 1
Use float: left
+ clear: both
.
HTML:
<div>
<div class="float-left gutter-right">xx</div>
<div class="float-left gutter-right">yy</div>
</div>
<div class="clear">zz</div>
CSS:
div.float-left { float: left; }
div.clear { clear: both; }
Explanation:
I used the class float-left
of the first 2 divs so that they may come in one line. Then I add a class of .clear
to the last div so that I could bring it in a seprate line where it will have no object floating neither left or right of it.
Demonstration 1.
Approach 2
Use display: inline
.
HTML:
<div>
<div class="float-left gutter-right inline">xx</div>
<div class="float-left gutter-right inline">yy</div>
</div>
<div class="clear">zz</div>
CSS:
div.inline { display: inline; }
Explanation:
I have added a class .inline
to the first 2 divs and applied the style display: inline
to this class and so those two first div will be displayed inline and then you don't need to clear:both
the last div.
Demonstration 2.
class
to the xxdiv
andfloat:left;
.