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. 非旋Treap及其可持久化

    平衡树这种东西,我只会splay.splay比较好理解,并且好打,操作方便. 我以前学过SBT,但并不是很理解,所以就忘了怎么打了. 许多用平衡树的问题其实可以用线段树来解决,我们真正打平衡树的时候一 ...

  2. 自然数幂求和——第二类Strling数

    这个问题似乎有很多种求法,但感觉上第二类Strling数的做法是最方便的. 问题 求下面这个式子: ∑i=0nik\sum_{i=0}^n i^ki=0∑n​ik nnn的范围可以很大. 第二类Str ...

  3. 廖雪峰Java11多线程编程-3高级concurrent包-4Concurrent集合

    Concurrent 用ReentrantLock+Condition实现Blocking Queue. Blocking Queue:当一个线程调用getTask()时,该方法内部可能让给线程进入等 ...

  4. 数论GCD——cf1055C

    被一道数论题卡了半天 网上的题解说只要匹配l或者r就行,想了下还真是.. 能让r1和r2对其就让他们对其,不能对其就讨论一下两种情况就可以了 #include <bits/stdc++.h> ...

  5. 对比两个String无规律包含连续4个相同字符返回true的方法

    package com.qif.dsa.util; import java.util.ArrayList; import java.util.List; /** * @author * @Title: ...

  6. webstorm中使用git管理服务器上的代码——入门级

    一.首先要确保电脑已经成功安装好git了.(记住git的安装位置) 二.这里需要给webstorm配置一下:依次点击:file –> Settings –> Version Control ...

  7. 手势UIGestureRecognizer

    UIGestureRecognizer抽象类,六大手势是其子类: UITapGestureRecognizer      点击 UIPinchGestureRecognizer         缩放 ...

  8. (Eclipse) 安装Subversion1.82(SVN)插件

    简介    :SVN是团队开发的代码管理工具,它使我们得以进行多人在同一平台之下的团队开发. 解决问题:Eclipse下的的SVN插件安装. 学到    :Eclipse下的的SVN插件安装. 资源地 ...

  9. VC文件操作

    VC文件操作 重命名文件: 注意: 该操作对文件夹一样有效! CFileFind Finder; CString sOldPath = _T("D:\\tt.txt"); CStr ...

  10. 理解JWT

    1. JSON Web Token是什么 JSON Web Token (JWT)是一个开放标准(RFC 7519),它定义了一种紧凑的.自包含的方式,用于作为JSON对象在各方之间安全地传输信息.该 ...