css - How can I apply clear both to wrap inside elemets in my container -
how can apply clear both wrap inside elemets in container
.container{ background:blue; } .box{ float:left; width:75px; height:75px; margin:5px 5px; background:red; } .box:after{ clear:both; } i want boxes warpped container! thanks
you can way:
.container:after{ clear:both; content: " "; display: block; } or
remove float , use display: inline-block
.box{ width:75px; height:75px; margin:5px 5px; background:red; display: inline-block; }
Comments
Post a Comment