css学习笔记: 重置默认样式 css reset

作者:好好 来源:好好blog 时间:2009-07-19 14:30:00 

最近看到一个词叫css reset。什么叫做css reset呢?我理解为重置css,也就是重置默认样式。我在HTML下的默认样式中讲到,一些标签元素在HTML下有一个默认属性值,我们在写css页面的时候,为了避免在css中重复定义它们,我们需要重置默认样式(css reset)。每个人的用法和写法都不一样。找到一篇关于css reset的调查文章, 可以看看国外使用css reset的比例调查。

 


这里有一篇总结css reset比较全面的文章,列举了多种css reset的写法,可以看看。
译文地址查看
原文地址查看

接下来我也查看了国内的两个网站,用Firebug按F12看看他们的css reset怎么写的?

淘宝

html {
overflow-x:auto;
overflow-y:scroll;
}
body, dl, dt, dd, ul, ol, li, pre, form, fieldset, input, p, blockquote, th, td {
font-weight:400;
margin:0;
padding:0;
}
h1, h2, h3, h4, h4, h5 {
margin:0;
padding:0;
}
body {
background-color:#FFFFFF;
color:#666666;
font-family:Helvetica,Arial,sans-serif;
font-size:12px;
padding:0 10px;
text-align:left;
}
select {
font-size:12px;
}
table {
border-collapse:collapse;
}
fieldset, img {
border:0 none;
}
fieldset {
margin:0;
padding:0;
}
fieldset p {
margin:0;
padding:0 0 0 8px;
}
legend {
display:none;
}
address, caption, em, strong, th, i {
font-style:normal;
font-weight:400;
}
table caption {
margin-left:-1px;
}
hr {
border-bottom:1px solid #FFFFFF;
border-top:1px solid #E4E4E4;
border-width:1px 0;
clear:both;
height:2px;
margin:5px 0;
overflow:hidden;
}
ol, ul {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
}
caption, th {
text-align:left;
}
q:before, q:after, blockquote:before, blockquote:after {
content:"";
}

百度有啊:(架构基本上是模仿YUI来做的)

body {
font-family:arial,helvetica,sans-serif;
font-size:13px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:1.4;
text-align:center;
}
body, ul, ol, dl, dd, h1, h2, h3, h4, h5, h6, p, form, fieldset, legend, input, textarea, select, button, th, td {
margin:0;
padding:0;
}
h1, h2, h3, h4, h5, h6 {
font-size:100%;
font-weight:normal;
}
table {
font-size:inherit;
}
input, select {
font-family:arial,helvetica,clean,sans-serif;
font-size:100%;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
button {
overflow:visible;
}
th, em, strong, b, address, cite {
font-style:normal;
font-weight:normal;
}
li {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
}
img, fieldset {
border:0 none;
}
ins {
text-decoration:none;
}

标签:css,reset,重置,样式
0
投稿

猜你喜欢

  • 解决SQLServer最大流水号的两个好方法

    2009-01-13 14:15:00
  • ASP中的301跳转和302跳转

    2008-08-06 18:40:00
  • Oracle 下的开发日积月累

    2009-02-28 11:08:00
  • 教你轻松学会SQL Server记录轮班的技巧

    2009-02-19 17:38:00
  • 日式酒店电梯面板设计

    2008-06-08 13:23:00
  • 菜鸟课堂:MySQL权限的详细解答

    2009-09-03 11:43:00
  • mysql基础教程:安装与操作

    2009-07-30 08:18:00
  • asp如何读取服务器上的驱动器?

    2009-11-18 20:50:00
  • 如何正确编写高质量高性能的MySQL语法

    2008-11-27 15:43:00
  • Recipe: 把SQL数据库部署到远程主机环境(第一部分)

    2007-09-23 13:07:00
  • 超级连接的title提示中如何换行实现多行显示

    2008-03-07 15:57:00
  • 发个js从样式表取值的函数

    2008-05-20 12:23:00
  • 文本框textarea限制输入文字个数的方法

    2008-01-28 13:02:00
  • ASP 三层架构 Error处理类

    2011-03-16 11:06:00
  • Oracle 用户权限管理方法

    2009-08-15 10:54:00
  • 用XML创建可排序、分页的数据显示页面

    2008-04-22 18:25:00
  • FF下,用 col 隐藏表格列的方法详解!

    2008-04-02 11:35:00
  • 给验证码增加干扰的杂点

    2008-05-16 11:34:00
  • Active Server Pages 错误 “ASP 0141”

    2009-08-19 17:10:00
  • fso文件按照文件名字母排序

    2008-03-09 15:25:00
  • asp之家 网络编程 m.aspxhome.com