This is the HTML layout:
... 相关标签: 2条回答 猫巷女王i 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) 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
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.
margin-top: 10px;
Put right floated div just before the float left div