css把多個塊強制在一行顯示

來源:互聯網
上載者:User
<!DOCTYPE><html><head><title></title><style type="text/css">* { margin:0; padding:0; list-style:none;}.div { width:300px; margin:0 auto; background:#000; overflow:auto;}.div:after{ content:"."; display:block; height:0; clear:both; visibility:hidden;}.con { margin-left:-30000px; left:30000px; position:relative; float:left;}ul { width:100px; height:50px; background:#f60; float:left; margin-left:10px;}</style></head><body><div class="div">    <div class="con">    <ul>        <li>1</li>        <li>2</li>            </ul>        <ul>        <li>1</li>        <li>2</li>            </ul>        <ul>        <li>1</li>        <li>2</li>            </ul>   </div></div></body></html>

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.