Dar*_*ein 122 css html5 css-reset
您使用哪个HTML5重置CSS以及为什么?有没有你发现可以覆盖更多的案件?
我开始使用HTML5 Doctor's:http://html5doctor.com/html-5-reset-stylesheet/它似乎有用,但我想知道是否有更好的东西.
Und*_*ned 40
实话:尽管降价kaikai是正确的,你只需要将*padding&margin重置为0.
虽然不幸的是,我们99%的人没有资源或人力来跟上那里的数百个浏览器版本.因此,重置表对于典型的网站至关重要.
html5reset :(太干扰了)
img,
object,
embed {max-width: 100%;}
Run Code Online (Sandbox Code Playgroud)
和:
html {overflow-y: scroll;}
Run Code Online (Sandbox Code Playgroud)
我知道它有良好的意图但是,这不是重置表的工作.它做了太多的假设.
BluePrint重置:(字面意思是蓝图)
body {
line-height: 1.5;
background: white;
}
Run Code Online (Sandbox Code Playgroud)
怎么了1.5.为什么背景是白色的?(我知道这是为了纠正,但仍然没有必要)
Normalize.css :(不正常)
https://github.com/necolas/normalize.css/blob/master/normalize.css
它开始很好用一些webkit /即黑客但是
h1 {
font-size: 2em;
margin: 0.67em 0;
}
h2 {
font-size: 1.5em;
margin: 0.83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: 0.83em;
margin: 1.67em 0;
}
h6 {
font-size: 0.75em;
margin: 2.33em 0;
}
Run Code Online (Sandbox Code Playgroud)
每个标头标签都是目标.他们不会重置身体的线高.
我确信以上所有工作都做得很好,但可能会超出必要的范围.
埃里克迈耶
YUI
HTML5Boilerplate
以上是更多的专业人士与Boilerplate倾向于(友好)方面,我敢肯定由于受欢迎.目前80%的定制重置是样板.
我会一点一点地去做自己的事情,这不是火箭科学.
Mat*_*ith 19
Normalize.css is great for both desktop and mobile browsers and is used in many popular HTML templates.
But what about using the CSS all property which resets CSS properties except direction and unicode-bidi? That way you don't need to include any additional files:
all
它目前在Firefox中得到支持,希望其他人也会效仿,使重置过程变得非常简单.
* {
margin: 0;
padding: 0;
}
Run Code Online (Sandbox Code Playgroud)
简单但完全有效。也许添加一个:
body {
font-size: small;
}
Run Code Online (Sandbox Code Playgroud)
为了更好的衡量。