首页 > 代码库 > CSS 浮动 终极解决方案

CSS 浮动 终极解决方案

 <style type="text/css">
  .clear{background:red;width:200px;}
  .clear:after{content:"\200B";display:block;clear:both;height:0;}
  .clear{*zoom:1;}
  .left{float:left;background:yellow;}
  .right{float:right;background:blue;}
  </style>
 </head>
 <body>
  
  <div class="clear">
    <div class="left"><p>fsdfdfdsf</p></div>
    <div class="right"><p>fsdfdfdsf</p><p>fsdfdfdsf</p></div>
  </div>