<style> .box { background-color: gray; border: solid 1px black; } .box .img { float: left; width: 100px; height: 100px; } .clearfix { *zoom: 1; } .clearfix:after { content: "020"; display: block; height: 0; clear: both; visibility: hidden; } </style> <div class="box clearfix"> <div class="img"></div> </div>
<style> .box { background-color: gray; border: solid 1px black; } .box .img { float: left; width: 100px; height: 100px; } .clear { clear: both; } </style> <div class="box clearfix"> <div class="img"></div> <div class="clear"></div> </div>
<style> .box { background-color: gray; border: solid 1px black; overflow: hidden; } .box .img { float: left; width: 100px; height: 100px; } </style> <div class="box"> <div class="img"></div> </div>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
css3 flex布局 justify-content:space-between 最后一行左对齐
网友评论