源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

float引起层飘出父层的解决方法

  • 时间:2021-12-14 20:59 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:float引起层飘出父层的解决方法
[b]1.加clear空div [/b] .clearfix:after { content: “.”; display: block; height: 0; clear: both; visibility: hidden;} .clearfix {display: inline-block;} /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} .clearfix {display: block;}/* End hide from IE-mac */ .clearfix { display: block; margin: 0px; clear: both; padding: 0px; visibility: hidden; background-color:#666666; border:0px none #FFFFFF; } .clearfix:after { height: 1px;} 使用方法: 在所有浮动层之后加上这个层 <div class=”clearfix”></div> 2.把背景层加浮动,但是这个方法会影响其他的div,有时候好用。 3.加 overflow 这个也有问题,会影响div的外观。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部