CSS float keep element inside DIV

HTML Add comments

If you have come across the problem of containing floats, then there’s a simple fix to your problem. Typical scenario, you have an img tag (image) inside a div tag. The img is set to float (left of right), and the div tag is not big enough to contain all the img, so the img sticks out. The solution: hr tag at the bottom of the div tag, with the following CSS:

div.item hr { display: block; clear: left; margin: -0.66em 0; visibility: hidden; }

click here for more info

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in