side by side divs

后端 未结 7 2168
忘掉有多难
忘掉有多难 2020-12-19 01:25

I\'ve got 4 divs inside a parent div. To get them to appear side by side, I\'ve given all 4 divs a style with float:left. The divs do appear side by side, but the parent d

7条回答
  •  感情败类
    2020-12-19 02:06

    I recommend the clearfix method as well. This problem occurs because floating an element removes any height that it would normally contain.

    PositionIsEverything posts a complete explanation as well as corresponding solutions for IE6, since the :after pseudoselector is not supported by older browsers.

提交回复
热议问题