码迷,mamicode.com
首页 > 其他好文 > 详细

ul的margin撑不开想要的距离的办法

时间:2017-08-27 17:03:59      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:back   边框   建议   wrap   arp   begin   pad   body   isp   

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  5. <title>test</title>
  6. <style type="text/css">
  7. *{margin:0;
  8.   padding;0;}
  9. span{background:#fdb48c;}
  10. .warp{background:#666;
  11.       border:#000000 1px solid}
  12. .warp ul{display:block; background:#ccc; list-style:none; margin:10px; padding:0px;}
  13. </style>
  14. </head>
  15. <body>
  16. <span> begin begin begin </span>
  17. <div class="warp">
  18.   <ul>
  19.     <li>text text</li>
  20.     <li>text text</li>
  21.     <li>text text</li>
  22.     <li>text text</li>
  23.     <li>text text</li>
  24.   </ul>
  25. </div>
  26. <span> end end end end </span>
  27. </body>
  28. </html>

复制代码
给wrap加上边框可以解决这问题,,不过建议把ul:margin改为wrap:padding,,,更佳

ul的margin撑不开想要的距离的办法

标签:back   边框   建议   wrap   arp   begin   pad   body   isp   

原文地址:http://www.cnblogs.com/wlgwilianm123/p/7440586.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!