当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > Css Reset(复位)的简单介绍

CSS样式表
正确地利用css改进网站设计的3个技巧
CSS网页设计 把HTML标记分类
几个Reset CSS的八卦问题
css 网页虚线制作方法剖析
网页制作小技巧 dl dt dd标签用法
玩转CSS3色彩
RGBa色彩的浏览器支持分析
WEB标准心得之网页重构的思路
学习web标准的十个重要理由总结
CSS 星级评价效果代码
ie6 fixed bug的解决方法 (css+js)
html pre标签使文本自动换行
CSS word-wrap同word-break的区别
css 入门基础教程
IE7或者IE8全屏解决方案
JavaScript CSS Style属性对照表
优秀设计和卓越设计之间的细微区别
CSS教程:容易忽略的但是很熟悉的CSS属性
通过语义化的标签减少DIV简化网页代码
html和css实现数据图表的展示效果

CSS样式表 中的 Css Reset(复位)的简单介绍


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 232 ::
收藏到网摘: n/a


Css Reset是什么? 有些同行叫 "css复位",有些可能叫 "默认css".....
相信看完全文您会对Css Reset有个重新的认识
原文地址:
http://perishablepress.com/press/2007/10/23/a-killer-collection-of-global-css-reset-styles/
PS:
* {
padding: 0;
margin: 0;
}

这就是最常用的Css Reset,但是这里会有很多问题。
原文前部分说了很多关于Css,以及各浏览器的css规则的不同,而制定"Css Reset"也是为了兼容与统一,正确有效的使用"Css Reset"可以在某种程度上节约时间与金钱.
非常感谢Perishable的整理与归纳
下面是关于几类Css Reset的简单介绍,本人能力有限.只能理解大概意思,还请各位看官见谅.
Minimalistic Reset [ Version 1 ]
相信这一段你经常看到.而且也是我们经常用到的
* {
padding: 0;
margin: 0;
}

Minimalistic Reset [ Version 2 ]
border:0的设计有些不靠谱了
* {
padding: 0;
margin: 0;
border: 0;
}

Minimalistic Reset [ Version 3 ]
当然这个也是不推荐的.会跟某些默认样式有冲突
* {
outline: 0;
padding: 0;
margin: 0;
border: 0;
}

Condensed Universal Reset
这是作者当前比较钟意的一种写法.保证了相对普遍浏览器样式的统一性.
* {
vertical-align: baselinebaseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
font-size: 100%;
border: 0 none;
outline: 0;
padding: 0;
margin: 0;
}

                                                   

Poor Man’s Reset
其实这也是我们常用的一类Css Reset.对字体的大小复位,以及图片链接的边框处理.
也经常在某些站点看到
html, body {
padding: 0;
margin: 0;
}
html {
font-size: 1em;
}
body {
font-size: 100%;
}
a img, :link img, :visited img {
border: 0;
}

Shaun Inman’s Global Reset
作者认为Shaun写这类的Css Reset是有某种目的性.
而且这类规则是针对的是某些重要的常用浏览器.
比如ie,firefox等
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre,
form, fieldset, input, p, blockquote, table, th, td, embed, object {
padding: 0;
margin: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset, img, abbr {
border: 0;
}
address, caption, cite, code, dfn, em,
h1, h2, h3, h4, h5, h6, strong, th, var {
font-weight: normal;
font-style: normal;
}
ul {
list-style: none;
}
caption, th {
text-align: left;
}
h1, h2, h3, h4, h5, h6 {
font-size: 1.0em;
}
q:before, q:after {
content: '';
}
a, ins {
text-decoration: none;
}

Yahoo CSS Reset
yahoo这帮家伙写的Reset个人觉得可以推荐
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,
fieldset,input,textarea,p,blockquote,th,td {
padding: 0;
margin: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,img {
border: 0;
}
address,caption,cite,code,dfn,em,strong,th,var {
font-weight: normal;
font-style: normal;
}
ol,ul {
list-style: none;
}
caption,th {
text-align: left;
}
h1,h2,h3,h4,h5,h6 {
font-weight: normal;
font-size: 100%;
}
q:before,q:after {
content:'';
}
abbr,acronym { border: 0;
}