方法一:添加新的元素 、应用 clear:both

.clear{
   clear:both; 
   height: 0; 
   height: 0; 
   overflow:hidden;
}

 

方法二:父级div定义 overflow: auto

.over-flow{
    overflow: auto; 
    zoom: 1; //处理兼容性问题
}

 

方法三: 伪类  :after 方法  outer是父div的样式

.outer {zoom:1;}    /*==for IE6/7 Maxthon2==*/
.outer :after {
   clear:both;
   content:'.';
   display:block;
   width: 0;
   height: 0;
   visibility:hidden;
}

 

相关文章:

  • 2021-12-05
  • 2021-12-22
  • 2021-10-18
  • 2021-12-26
  • 2022-12-23
  • 2021-09-02
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案