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 { 
 
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:""; 
}

百度有啊(www.youa.com):(架构基本上是模仿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》一书中建议我们做网站开始重置所有默认样式: 
/* Normalizes margin,padding */ 
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td { margin:0;padding:0} 
/* Normalizes font-size for headers */ 
h1,h2,h3,h4,h5,h6 { font-size:100%} 
/* Removes list-style from lists */ 
ol,ul { list-style:none } 
/* Normalizes font-size and font-weight to normal */ 
address,caption,cite,code,dfn,em,strong,th,var { font-size:normal; font-weight:normal } 
/* Removes list-style from lists */ 
table { border-collapse:collapse; border-spacing:0 } 
/* Removes border from fieldset and img */ 
fieldset,img { border:0 } 
/* Left-aligns text in caption and th */ 
caption,th { text-align:left } 
/* Removes quotation marks from q */ 
q:before,q:after { content:''} 
那我们实际写代码的时候该怎么来css reset呢? 
我个人推荐使用(Eric Meyer和YUI)的 css reset 
Eric Meyer's Reset: 
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, 
b, u, i, center, 
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-size: 100%; 
vertical-align: baseline; 
background: transparent; 

body { 
line-height: 1; 

ol, ul { 
list-style: none; 

blockquote, q { 
quotes: none; 

blockquote:before, blockquote:after, 
q:before, q:after { 
content: ''; 
content: none; 

/* remember to define focus styles! */ 
:focus { 
outline: 0; 

/* remember to highlight inserts somehow! */ 
ins { 
text-decoration: none; 

del { 
text-decoration: line-through; 

/* tables still need 'cellspacing="0"' in the markup */ 
table { 
border-collapse: collapse; 
border-spacing: 0; 

YUI: 
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { 
margin:0; 
padding:0; 

table { 
border-collapse:collapse; 
border-spacing:0; 

fieldset,img { 
border:0; 

address,caption,cite,code,dfn,em,strong,th,var { 
font-style:normal; 
font-weight:normal; 

ol,ul { 
list-style:none; 

caption,th { 
text-align:left; 

h1,h2,h3,h4,h5,h6 { 
font-size:100%; 
font-weight:normal; 

q:before,q:after { 
content:''; 

abbr,acronym { border:0; 

结合他们的css reset写法,再根据自己的实际情况,一定能写出符合自己网站的完美的css reset。

重置默认样式 css reset的更多相关文章

  1. 清除浏览器默认样式——css reset & normalize.css

    css reset 自己挨个清除很麻烦 可以使用网上一些css库——css reset 把模板复制到css文件最上方,其他的样式我们自己编写来覆盖它们 但是这个也有一些弊端,会把一些本来需要的样式给清 ...

  2. CSS 重置默认样式

    1. 概述 1.1 说明 css重置样式主要是为了让各个浏览器的CSS样式有一个统一的基准,使HTML元素样式在跨浏览器时有一致性的效果. 备注:浏览器的兼容问题,不同浏览器对有些标签的默认值是不同的 ...

  3. 清除浏览器默认样式的reset.css(转载于reset.css的官方)

    /* http://meyerweb.com/eric/tools/css/reset/ v2.0-modified | 20110126 License: none (public domain) ...

  4. 浏览器默认样式及reset

    写在前面 首先纠正一个易错概念.div并非生来就是块元素,而是每个浏览器都有一套默认的css样式(优先级最低),默认样式里会把div设置成display: block;还有margin,padding ...

  5. 统一各浏览器CSS 样式——CSS Reset

    html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, ...

  6. 重置浏览器的默认样式(css reset)

    (1)定义:首先css reset指的是重置浏览器的默认样式 (2)作用:因为现在的浏览器很多,并且每个浏览器都有自己的默认样式,这样就会导致一个页面在多个浏览器下展示产生差异,所以我们需要做一些处理 ...

  7. CSS Reset(样式重置)

    CSS Reset,意为重置默认样式.HTML中绝大部分标签元素在网页显示中都有一个默认属性值,通常为了避免重复定义元素样式,需要进行重置默认样式(CSS Reset).举几个例子:1.淘宝(CSS ...

  8. 一个简易的css reset

    /*css reset*/ /*清除内外边距*/ body, h1, h2, h3, h4, h5, h6, p, hr, /*结构元素*/ ul, ol, li, dl, dt, dd, /*列表元 ...

  9. 默认样式重置 (css reset)

    body,p,h1,h2,h3,h4,h5,h6,dl,dd,t{margin:0; font-size:12px;/* font-family:XX; */} ol,ul{list-style:no ...

随机推荐

  1. poj 3621(最优比率环)

    Sightseeing Cows Farmer John has decided to reward his cows for their hard work by taking them on a ...

  2. bzoj1216 操作系统(优先队列模拟)

    1216: [HNOI2003]操作系统 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1172  Solved: 649[Submit][Statu ...

  3. bzoj1051受欢迎的牛(Tarjan)

    1051: [HAOI2006]受欢迎的牛 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 4776  Solved: 2542 Description ...

  4. Asp.Net 开发实战技术

    1.什么是WMI技术 WMI是一项核心的Windows管理技术,WMI作为一种规范和基础结构,通过它可以访问.配置.管理和监视几乎所有的Windows资源,比如用户可以在远程计算机器上启动一个进程:设 ...

  5. [Qt Creator 快速入门] 第1章 Qt Creator简介

    Qt Creator 是一个跨平台的.完整的 Qt 集成开发环境,其中包括了高级C++代码编辑器.项目和生成管理工具.集成的上下文相关的帮助系统.图形化调试器.代码管理和浏览工具等.这一章先对 Qt ...

  6. 51nod2006 飞行员配对(二分图最大匹配)

    2006 飞行员配对(二分图最大匹配) 题目来源: 网络流24题 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题  收藏  关注 第二次世界大战时期,英国皇家空军从沦陷国 ...

  7. EditText(1)EditText的类型和回车键的行为

    1,常见类型 <EditText android:id="@+id/email_address" android:layout_width="fill_parent ...

  8. Spring.Net学习笔记(4)-属性及构造器注入

    一.开发环境 操作系统:Win10 编译器:VS2013 .Net版本:.net framework4.5 二.涉及程序集 Spring.Core.dll:1.3.1 Common.Logging.d ...

  9. Meta标签 h5

    一  PC端meta标签 1 页面关键词 <meta name="keywords" content="your tags"> 2 页面描述 < ...

  10. python自动化--模块操作之re、MySQL、Excel

    一.python自有模块正则 import re # re.match只匹配字符串的开始,如果字符串开始不符合正则表达式,则匹配失败,函数返回None print(re.match("www ...