すべての要素にグローバル スタイルを適用することの欠点はありますか?
*{
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/の一般的なテクニックを使用することをお勧めします
*Border-box は、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;
}