开发者

html div going behind img

开发者 https://www.devze.com 2023-03-30 18:51 出处:网络
Im trying to make this layout (many of these are in a list): An image (of varying height, but a set width) on the left. To the right is an <h2>, and below that, b开发者_高级运维ut still to the

Im trying to make this layout (many of these are in a list):

An image (of varying height, but a set width) on the left. To the right is an <h2>, and below that, b开发者_高级运维ut still to the right of the image is a div with other content in it.

The div is used to provide a different colored background. Right now, the div for some reason extends behind the image, and the images has a varying distance between them, and sometimes one element will get pushed to the right by the height of the image above.

http://jsfiddle.net/RQsUc/


Add overflow: hidden to your outermost divs (div (display: block)) to contain the floats.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号