css float and padding

前端 未结 2 1156
再見小時候
再見小時候 2021-01-03 21:41

This is the HTML layout:

        
...
相关标签:
2条回答
  • 2021-01-03 21:46

    When you float an element, it's effectively taking it out of the document flow, so adding padding to its parent won't have an effect on it. You could use margin-top: 10px; on both of your inner divs.

    0 讨论(0)
  • 2021-01-03 21:57

    Put right floated div just before the float left div

    0 讨论(0)
提交回复
热议问题