side by side divs

后端 未结 7 2199
忘掉有多难
忘掉有多难 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:04

    After the 4 divs, you need to "cancel" the float style. This is done through the creation of a p for example, like:

    Your parent div will automatically get the right size.

提交回复
热议问题