CSS Reset是指重设浏览器的样式。在各种浏览器中,都会对CSS的选择器默认一些数值,譬如当h1没有被设置数值时,显示一定大小。

  但并不是所有的浏览器都使用一样的数值,所以有了CSS Reset,以让网页的样式在各浏览器中表现一致。

  下面介绍几个主流的CSS Reset代码:

  1、Eric Meyer

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, 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,

  article, aside, canvas, details, embed,

  figure, figcaption, footer, header, hgroup,

  menu, nav, output, ruby, section, summary,

  time, mark, audio, video {

  margin: ;

  padding: ;

  border: ;

  font-size: %;

  font: inherit;

  vertical-align: baseline;

  }

  /* HTML5 display-role reset for older browsers */

  article, aside, details, figcaption, figure,

  footer, header, hgroup, menu, nav, section {

  display: block;

  }

  body {

  line-height: ;

  }

  ol, ul {

  list-style: none;

  }

  blockquote, q {

  quotes: none;

  }

  blockquote:before, blockquote:after,

  q:before, q:after {

  content: '';

  content: none;

  }

  table {

  border-collapse: collapse;

  border-spacing: ;

  }

  2、YUI

  

/*

  YUI 3.4.1 (build 4118)

  Copyright 2011 Yahoo! Inc. All rights reserved.

  Licensed under the BSD License.

  http://yuilibrary.com/license/

  */

  /*

  TODO will need to remove settings on HTML since we can’t namespace it.

  TODO with the prefix,should I group by selector or property for weight savings?

  */

  html {

  color:#;

  background:#FFF;

  }

  /*

  TODO remove settings on BODY since we can’t namespace it.

  */

  /*

  TODO test putting a class on HEAD.

  - Fails on FF.

  */

  body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td {

  margin:;

  padding:;

  }

  table {

  border-collapse:collapse;

  border-spacing:;

  }

  fieldset,img {

  border:;

  }

  /*

  TODO think about hanlding inheritence differently,maybe letting IE6 fail a bit…

  */

  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:%;

  font-weight:normal;

  }

  q:before,q:after {

  content:'';

  }

  abbr,acronym {

  border:;

  font-variant:normal;

  }

  /* to preserve line-height and selector appearance */

  sup {

  vertical-align:text-top;

  }

  sub {

  vertical-align:text-bottom;

  }

  input,textarea,select {

  font-family:inherit;

  font-size:inherit;

  font-weight:inherit;

  }

  /*to enable resizing for IE*/

  input,textarea,select {

  *font-size:%;

  }

  /*because legend doesn’t inherit in IE */

  legend {

  color:#;

  }

  3、csslab

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, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,

  article, aside, dialog, figure, header, footer, hgroup, menu, nav, section, time, mark, audio, video {

  margin: ;

  padding: ;

  border: ;

  outline: ;

  font-weight: inherit;

  font-style: inherit;

  font-size: %;

  }

  article, aside, nav, section, dialog, figure, header, footer, hgroup {

  display:block;

  }

  legend {

  display:none;

  }

  :focus {

  outline: ;

  }

  table {

  border-collapse: collapse;

  border-spacing: ;

  }

  caption, th, td {

  text-align: left;

  font-weight: normal;

  }

  a img, iframe {

  border: none;

  }

  ul {

  list-style: none;

  }

  input, textarea, select, button {

  font-size: %;

  font-family: inherit;

  }

  input, select {

  vertical-align:middle;

  }

  select {

  margin: inherit;

  }

  button {

  border: ;

  padding: ;

  background: transparent;

  cursor: pointer;

  }

  /* Fixes incorrect placement of numbers in ol’s in IE6/7 */

  ol { margin-left:2em; }

  /* ========================================= clearfix == */

  .clearfix:after {

  content: ".";

  display: block;

  height: ;

  clear: both;

  visibility: hidden;

  }

  .clearfix {display: inline-block;}

  * html .clearfix {height: %;}

  .clearfix {display: block;}

CSS Reset(CSS重置)的更多相关文章

  1. css reset.css

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

  2. css reset的重置作用(可取还是不可取,取决于你)

    一.重置的理由 当今流行的浏览器中,有些都是以自己的方式去理解css规范,这就会到只有的浏览器对css的解释与设计师的css定义初衷相冲突,使得网页的样子在某些浏览器下能正确按照设计师的想法显示.,但 ...

  3. CSS Reset样式重置

    为了让页面在各不同浏览器之间显示效果一致,CSS样式清除和重置是前端开发必需要做的事情,结合前车之鉴,整理了份CSS重置样式代码供参考. @charset "utf-8"; /* ...

  4. 代码:CSS——reset.css

    http://www.cnblogs.com/qq21270/p/5577856.html 图片列表 A链接标签: /* 链接样式.文字颜色 */ a{color:#666;text-decorati ...

  5. CSS RESET —— 浏览器样式重置

    CSS Reset 1. CSS Reset为什么存在? 只要您的客户存在使用不同浏览器(ie,firefox,chrome等)的可能,那你就不得不从完美的理想状态回到现实,因为不同核心的浏览器对CS ...

  6. 关于CSS reset

    关于CSS resetCSS reset(css重置)基本上是不需要的,至少可以说80%的的CSS reset都是没有必要的,反而增加了页面CSS 的overwrite,尤其像开心网*{margin: ...

  7. 国际知名CSS Reset 总结

    NO.01   CSS Tools: Reset CSS 网站:https://meyerweb.com/eric/tools/css/reset/ 优点:老牌,用的人多. /* http://mey ...

  8. 关于reset.css的疑问:为什么一定要重置浏览器样式?

    自开始做前端算起,我所做过的每一个项目中都会有一个reset.css,也就是重置样式表.我现在想想都不知道第一次是从哪儿弄来的一个重置样式表.快五年了,好像从来都没有质疑过关于重置样式表的内容. 这样 ...

  9. css reset重置样式有那么重要吗?

    在以前写html代码的时候,一般都会在head里添加重置样式reset.css,其内容如下: @charset "utf-8"; html, body, div, span, ap ...

  10. 默认样式重置 (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. 廖雪峰Java12maven基础-1maven入门-2依赖管理

    maven 如果我们的项目依赖第三方的jar包: Commons Logging发布的jar包在那里下载? 使用Log4j需要哪些jar包 其他依赖:junit,Javamail,MySQL驱动... ...

  2. JDK源码阅读--Object

    在java.lang包下 Object类:是所有类的基类(父类) public final native Class<?> getClass(); 返回这个Object所代表的的运行时类 ...

  3. 《DSP using MATLAB》Problem 8.9

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  4. HDU--2126 Buy the souvenirs(二维01背包)

    题目http://acm.hdu.edu.cn/showproblem.php?pid=2126 分析:有两个要求,一是计算最多可以选多少中纪念品:而是计算选最多纪念品的方案有多少种, 即统计最优方案 ...

  5. Frame用navigate导航到新页面后导航条隐藏的方法

    设置Frame的NavigationUIVisibility="Hidden"

  6. MFC ,List使用

    出自http://www.cnblogs.com/yuehui/archive/2012/06/15/2550449.html List容器双向线性表list容器   list类定义了双向的线性表.V ...

  7. python print输出format太好用了

    不用担心什么其他的东西了,直接用format: print("{}的Ground,Detected,DetectedRight个数分别为{},{},{},".format(cate ...

  8. Tomcat Add and Remove 项目时提示 Project facet Java version 1.8 is not supported 错误

    原因:项目的jdk和tomcat的jdk版本不同 将eclipse-preference-server-runtime environments 点击你要用的tomcat 点击 edit-jre选择和 ...

  9. Android 开发 AudioRecord音频录制

    前言 Android SDK 提供了两套音频采集的API,分别是:MediaRecorder 和 AudioRecord,前者是一个更加上层一点的API,它可以直接把手机麦克风录入的音频数据进行编码压 ...

  10. Ansible 安装使用过程中遇到过的问题

    1.[root@ansible ~]# ansible-doc -l [DEPRECATION WARNING]: docker is kept for backwards compatibility ...