<style> .divClass{ width:500px; border:1px solid #ccc; } /*IE8下可以不用加(*zoom:1;*display:inline;需要添加在display后面)*/ .divClass span{ display:inline-block; width:160px; margin-left:20px; *zoom:1; *display:inline; } .ulClass{ width:500px; border:1px solid #ccc; margin-top:20px; } /*IE8下需要添加(*zoom:1;*display:inline;需要添加在display后面)*/ .ulClass li{ display:inline-block; width:160px; *zoom:1; *display:inline; } </style> <div class="divClass"> <span>测试span</span> <span>测试span</span> <span>测试span</span> <span>测试span</span> <span>测试span</span> <span>测试span</span> <span>测试span</span> <span>测试span</span> </div> <ul class="ulClass"> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> <li>测试li</li> </ul>
最终效果图: