CSS解决div不能include列表ul的问题

http://swiftthemes.com/2009/12/css-tips-and-hacks/problem-with-height-of-div-containing-floats-and-inline-lists/

  
  
  
  
  1. .clearfix:after { 
  2.  visibilityhidden
  3.  displayblock
  4.  font-size0
  5.  content:""
  6.  clearboth
  7.  height0
  8.  
  9. .clearfix {display: inline-block;} 
  10.  
  11. /* Hides from IE-mac \*/ 
  12. * html .clearfix {height1%;} 
  13. .clearfix {displayblock;} 
  14. /* End hide from IE-mac */ 

把container的div,加一个class=“clearfix”

你可能感兴趣的:(css,clearfix)