全局reset什么意思

精通CSS书上说
*{padding:0;margin:0;} 这种技术不区分元素,所以它对option等元素有不理影响。因此,使用全局reset把内边距和外边据显式地设置为0可能更安全

全局reset什么意思啊,是不是指*{margin:0;padding:0}?如果是 它这句话不是冲突吗

全局reset的意思就是把你项目所用到的标签整合起来,把默认的属性重新设置过,这样可以避免不同浏览器对不同标签的默认值不一样。
*{margin:0;padding:0}也是可以用的,是对所有标签的pading和margin为0,但是这样会加重浏览器渲染时候的加载时间,
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-09-14

一般很多网站都有这么一个重置默认样式的css文件,其实和*{padding:0;margin:0;}
意思是一样的,区别在于*是指所有标签,而有些人认为有的标签只有外边距没有内边距,有的则只有内边距没有外边距,你全部设置了不是多做了很多没用的功夫,加重浏览器负担神马的吗,也有人认为这种说法是狗屁,反正众说纷纭


以下就是我从某个网站复制的reset文件里的代码,你可以看看,可能就是书上说的显式的设置吧

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{margin:0;padding:0;outline:none;}
input.hidefocus::-moz-focus-inner {border:none;}
table{border-collapse:collapse;border-spacing:0;empty-cells:show;}
fieldset,img{border:0;}
address,caption,cite,code,dfn,em,strong,th,var,optgroup,b{font-style:inherit;font-weight:inherit;}
del,ins{text-decoration:none;}
li{list-style:none;}
caption,th{text-align:left;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
q:before,q:after{content:'';}
abbr,acronym{border:0;font-variant:normal;}
sup{vertical-align:baseline;}
sub{vertical-align:baseline;}
legend{color:#5A5A5A;}
input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}
input,button,textarea,select{font-size:100%;}
i,em{font-style:normal}

本回答被提问者采纳
第2个回答  2013-09-14
哎,我最不喜欢那种书了,非得说一些别人不容易懂的话好像才叫高深!
狗屁的全局reset:
*{margin:0;padding:0},这段话的把html元素的默认外边距和填充归零!
第3个回答  2013-09-14
重置浏览器元素

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网