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, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
来源:重置加载
简化版本
html,body,div,span,applet,object,iframe,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,label,legend,p,blockquote,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}body{line-height:1;color:black;background:white;}:focus{outline:0;}table{border-collapse:collapse;border-spacing:0;}caption,th,td{text-align:left;font-weight:normal;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul{list-style:none;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}blockquote:before,blockquote:after,q:before,q:after{content:"";}blockquote,q{quotes:"" "";}abbr,acronym{border:0;}
我最近注意到设计师重置:focus的趋势。您是否会做任何事情来恢复基于辅助功能的浏览器的行为?
即使Eric在上面的代码中也提到了它
/* 请记住定义焦点样式! */
如果您不想重置焦点样式,则删除或注释掉该焦点重置样式。
:)
行高至少应为1.25,最好为1.5甚至1.75,以帮助眼睛跳到文本块的下一行。
这是我对Meyer重置的最大不满。line-height: 1 只是纯粹的糟糕排版,虽然,是的,您可以在自己的样式表中更改它,但大多数人只是盲目地使用它,并使他们的博客文章非常难以阅读。
另一件事我本应该考虑的是……锚链接显示设置为块的地方……
感谢这个!非常有用:)!
这是一个 css 重置,旨在使所有浏览器呈现相同,因此行高应设置为 1。此外,将锚链接设置为显示块将是一场噩梦。
div 可以像 HTML5 的元素一样重置为 display:block; 吗?只是好奇想知道为什么不这样做。
“div 可以像 HTML5 的元素一样重置为 display:block; 吗?只是好奇想知道为什么不这样做。” – 是的,我也想知道同样的事情。