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. 2016/2/19 css样式表 Cascading Style Sheet 叠层样式表 美化HTML网页

    一.样式表 (一)样式表的分类 1.内联样式表 和HTML联合显示,控制精确,但是可重用性差,冗余较多. 例:<p style="font-size:14px;">内联 ...

  2. fused multiply and add

    1 要解决的问题 计算x*y + z?其中x.y.z都是浮点数. 2 普通的计算方式 e=3; s=4.734612 × e=5; s=5.417242 ----------------------- ...

  3. Linux/Android——Input系统之frameworks层InputManagerService (六)【转】

    本文转载自:http://blog.csdn.net/u013491946/article/details/72638954 版权声明:免责声明: 本人在此发文(包括但不限于汉字.拼音.拉丁字母)均为 ...

  4. Android6.0源码分析之录音功能(一)【转】

    本文转载自:http://blog.csdn.net/zrf1335348191/article/details/54949549 从现在开始一周时间研究录音,下周出来一个完整的博客,监督,激励!!! ...

  5. luogu 1901 发射站

    题目大意: 一个数列,它左边第一个比它高的人和右边第一个比它高的人要加上它的权值 思路: 单调栈维护一个单调递减的栈 正反各维护一遍 #include<iostream> #include ...

  6. vue watcher

    观察 Watchers 虽然计算属性在大多数情况下更合适,但有时也需要一个自定义的 watcher .这是为什么 Vue 提供一个更通用的方法通过watch 选项,来响应数据的变化.当你想要在数据变化 ...

  7. C的结构体函数

    #include<stdio.h> #include<string.h> struct Test { int age; ]; double score; }std1; //结构 ...

  8. 698C

    Description n个视频,长度为k的缓存,每次询问,每个视频以pi的概率被选,如果不在缓存区则加入,如果缓存区满了,则最先进缓存的出来,问10^100次操作以后每个视频在缓存的概率 Input ...

  9. 【FFmpeg】FFmpeg常用基本命令(转载)

    转自:http://www.cnblogs.com/dwdxdy/p/3240167.html 1.分离视频音频流 ffmpeg -i input_file -vcodec copy -an outp ...

  10. 如何快速删除Linux下的svn隐藏文件及其他临时文件 (转载)

    转自:http://blog.csdn.net/edsam49/article/details/5840489 在Linux下,你的代码工程如果是用svn进行管理的,要删除Linux kernel里的 ...