将全局样式应用于所有元素有什么缺点吗?
*{
margin: 0;
padding: 0;
border: 0;
list-style: none;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
将全局样式应用于所有元素有什么缺点吗?
*{
margin: 0;
padding: 0;
border: 0;
list-style: none;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*
是所谓的“重”选择器。但不幸的是,没有其他方法可以将边框模型应用于几行代码中的所有元素。谈论填充/边距和列表样式重置 - 最好使用www.cssreset.com/ 中的一些常用技术
*边框可以在这里应用,在 Eric Meyer 的 Reset CSS v2.0
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}