当前位置:Gxlcms > html代码 > 【求助】为什么在UL下的框左边会有边距?_html/css_WEB-ITnose

【求助】为什么在UL下的框左边会有边距?_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:51人阅读

     
  • 全部商品
  • 首页
  • 热卖宝贝
  • 新品抢购
  • 活动专区
  • 服务指南
  • 收藏店铺


回复讨论(解决方案)

默认情况下,body,ul 等标签有margin,padding值,需要重置一下默认值。

html, body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td, tbody {list-style:none; margin:0px; padding:0px; }

在你的css加上
body{ margin:0; padding:0; font:12px/1.5 Microsoft YaHei;background:#f2f2f2}
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, img, small, strike, sub, sup, tt, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, button, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; }
input{background:none;border:none;}
ul , li { list-style:none;}

默认情况下,body,ul 等标签有margin,padding值,需要重置一下默认值。
margin,padding设置成0就行了。另外样式也设置成none

.shopzp ul{margin:0; padding:0; float:left; clear:both;}

*{margin:0;padding:0;}改变所有属性的默认样式的内外编剧都为0,就可以了~

谢谢大家了 已经解决了

人气教程排行