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. 使用DUILIB建立项目

    使用DUILIB加载XML界面 这篇主要目的就是教给大家怎样在自己的工程中加载XML界面,这是最基本的应用,对于界面控件响应啥的,我就不讲了,在大家懂了这个之后,我会给大家一个其它人写的博客,再看他的 ...

  2. l洛谷 NOIP提高组模拟赛 Day2

    传送门 ## T1 区间修改+单点查询.差分树状数组. #include<iostream> #include<cstdio> #include<cstring> ...

  3. 2019/10/9 CSP-S 模拟测

    T1:最大约数和 给定一个正整数 S,现在要求你选出若干个互不相同的正整数,使得它们的和不大于 S,而且每个数的因数(不包括本身)之和最大.S <= 1000 分析: 其实考完才听他们说是背包, ...

  4. 6月份Github上最热门的Java开源项目!

    1.halo 这是一个轻快,简洁,功能强大,使用Java开发的博客系统. 项目地址:https://github.com/halo-dev/halo   Star 6139 2.jeecg-boot ...

  5. OpenCASCADE点向圆柱面投影

    OpenCASCADE点向圆柱面投影 eryar@163.com OpenCASCADE的类Extrema_ExtPElS提供了点到基本曲面的投影计算功能,距离可能是最大值或是最小值.如下图所示的点到 ...

  6. C++【vector】用法和例子

    /*** * vector 基础api复习 * 8 AUG 2018 */ #include <iostream> #include <vector> using namesp ...

  7. 枚举进程,线程,堆 CreateToolhelp32Snapshot

    Takes a snapshot of the processes and the heaps, modules, and threads used by the processes.对当前系统进行一 ...

  8. agc034

    A:题意:你有一个1 * n的网格,有些地方是障碍.你有两个人,分别要从a到b和从c到d,一次只能向右跳1步或者两步.求是否可行. 解:先判断有没有2个连续的障碍,然后判断是否能错车. #includ ...

  9. 尝试一下LLJ大佬的理论AC大法

    1.BZOJ 3522 Poi2014 Hotel DFS 给定一棵树,求有多少无序三元组(x,y,z)满足x,y,z互不相等且Dis(x,y)=Dis(y,z)=Dis(x,z) 枚举中心点,分别d ...

  10. linux php5.4安装phalcon

    PHP版本5.6以上,安装可参考.https://blog.csdn.net/happysdh/article/details/51450654 在phalcon3.0以后就不支持php5.4了. 要 ...