1、我们在写标签时,会发现无论是p、h、ul、img、form、button等等这些标签都会有初始自带这的默认样式,一般我们在做真正的项目开发都会把这些全清掉,然后再根据设计师所设计的具体样式进行重新样式设计,
比如淘宝网的会这样写:
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;
}
京东网的会这样写:
*{
margin: 0;
padding: 0;
}
当然,两种都可以,*号的代表所有标签更省事,如果按代码量给钱的话你可以选淘宝类型的写法。