元素等高
<div style="overflow:hidden;"> <div style="box-sizing:content-box;float:left;width:50%;background:red;padding-bottom:1000px;margin-bottom:-1000px;"> <p>iweuhfwehfwefhwfe</p> <p>iweuhfwehfwef</p> <p>iweuhfwehfw</p> </div> <div style="float:left;width:50%;background:blue;box-sizing:content-box;padding-bottom:1000px;margin-bottom:-1000px;"> <p>iweuhfwehfwe</p> <p>iweuhfwehfwe</p> <p>iweuhfwehfwe</p> <p>iweuhfwehf</p> <p>iweuhfweh</p>php </div> </div>
那个子元素矮的会被padding补齐,起到了内容等高的效果。padding-bottom与margin-bottom最好保证数值相等,padding为正,margin为父
能工摹形,巧匠窃意。