非常好用的CSS样式重置表

 
        我们在项目前期准备时都会准备好一个reset.css,因为不同浏览器对标签的解析各不相同,重置css样式可以让标签在不同浏览器下产生相同的效果。所以一个好的重置样式表是非常重要的。用过很多网上现成的样式重置表,然后有时写的样式代码没问题却达不到自己要的效果,查了才发现是掉进reset.css的坑里。这里推荐用过多种reset.css感觉是最好用的重置样式表:Sandal,这个样式表的好处是他绝大多数的保留了标签的常用效果,并不是简单粗暴的全部掩杀。具体样式如下,可以直接整个复制在自己的reset.css中:
  html { 
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    height: 100%; 
  } 
  body { 
    margin: 0;
    font-size: 14px;
    font-family: "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    #fff;
    min-height: 100%;
  } 
  article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section,summary { 
    display: block; 
  } 
  audio, canvas, progress, video { 
    display: inline-block; 
  } 
  audio:not([controls]) { 
    display: none;
    height: 0; 
  } 
  progress { 
    vertical-align: baseline; 
  } 
  [hidden], template { 
    display: none; 
  } 
  a {
    background: transparent;
    text-decoration: none;
    color: #08c;
  } 
  a:active { 
    outline: 0; 
  } 
  abbr[title] { 
    border-bottom: 1px dotted; 
  } 
  b, strong { 
    font-weight: bold; 
  } 
  dfn { 
    font-style: italic; 
  } 
  mark { 
    background: #ff0; color: #000; 
  } 
  small { 
    font-size: 80%; 
  } 
  sub, sup { 
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  } 
  sup { 
    top: -0.5em; 
  } 
  sub { 
    bottom: -0.25em; 
  } 
  img { 
    max-width: 100%;
    border: 0;
    vertical-align: middle;
  } 
  svg:not(:root) { 
    overflow: hidden; 
  } 
  pre { 
    overflow: auto;
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
  } 
  code, kbd, pre, samp { 
    font-family: monospace, monospace;
    font-size: 1em; 
  } 
  button, input, optgroup, select, textarea { 
    color: inherit;
    font: inherit;
    margin: 0;
    vertical-align: middle; 
  } 
  button, input, select { 
    overflow: visible; 
  } 
  button, select { 
    text-transform: none; 
  } 
  button, html input[type="button"], input[type="reset"], input[type="submit"] { 
    -webkit-appearance: button;
    cursor: pointer; 
  } 
  [disabled] { 
    cursor: default; 
  } 
  button::-moz-focus-inner, input::-moz-focus-inner { 
    border: 0;
    padding: 0; 
  } 
  input { 
    line-height: normal; 
  } 
  input[type="checkbox"], input[type="radio"] { 
    box-sizing: border-box;
    padding: 0;
  } 
  input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { 
    height: auto; 
  }
  input[type="search"] { 
    -webkit-appearance: textfield;
    box-sizing: border-box; 
  }
   input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { 
    -webkit-appearance: none; 
  }
  fieldset { 
    border: 1px solid #c0c0c0;
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em; 
  } 
  legend { 
    border: 0;
    padding: 0; 
  } 
  textarea { 
    overflow: auto;
    resize: vertical;
    vertical-align: top; 
  } 
  optgroup { 
    font-weight: bold; 
  } 
  input, select, textarea { 
    outline: 0; 
  } 
  textarea, input { 
    -webkit-user-modify: read-write-plaintext-only; 
  } 
  input::-ms-clear, input::-ms-reveal { 
    display: none; 
  } 
  input::-moz-placeholder, textarea::-moz-placeholder { 
    color: #999; 
  } 
  input:-ms-input-placeholder, textarea:-ms-input-placeholder { 
    color: #999; 
  } 
  input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
    color: #999; 
  } 
  .placeholder { 
    color: #999; 
  } 
  table { 
    border-collapse: collapse;
    border-spacing: 0; 
  } 
  td, th { 
    padding: 0; 
  } 
  h1, h2, h3, h4, h5, h6, p, figure, form, blockquote { 
    margin: 0; 
  } 
  ul, ol, li, dl, dd { 
    margin: 0; padding: 0; 
  } 
  ul, ol {
    list-style: none outside none; 
  } 
  h1, h2, h3 { 
    line-height: 2;
    font-weight: normal; 
  } 
  h1 { 
    font-size: 18px; 
  } 
  h2 { 
    font-size: 16px; 
  } 
  h3 { 
    font-size: 14px; 
  } 
  i { 
    font-style: normal; 
  } 
  * { 
    box-sizing: border-box; 
  } 
  .clearfix::before, .clearfix::after { 
    content: "";
    display: table; 
  } 
  .clearfix::after { 
    clear: both; 
  }
 
 
        基本的样式重置就这些,剩下自定义的就自己往里面添加。这份样式表放在这里方便以后自己使用,也希望能帮到有需要的你们。

非常好用的CSS样式重置表的更多相关文章

  1. css样式重置表

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

  2. 分享一下自己在用的CSS样式重置代码

    通过借鉴网上大牛们的经验和自己在工作中碰到的一些问题,总结出了这些比较常用的CSS样式重置的代码: @charset "utf-8"; /* 防止用户自定义背景颜色对网页的影响,添 ...

  3. css扁平化博客学习总结(二)css样式重置

    css样式重置 方法一:不推荐使用,这么写会让网页解析速度变慢. *{ margin: 0; padding: 0;} 方法二:大家常用的写法,比较流行. body, html, div, block ...

  4. css样式重置 移动端适配

    css  默认样式重置 @charset "utf-8"; *{margin:0;padding:0;} img {border:none; display:block;} em, ...

  5. CSS_简介/语法结构/长度单位/应用方式/标签的样式重置/表单样式重置

    一.CSS简介:  w3c(World Wide Web Consortium):万维网联盟,是规定网页标准的一个组织(叫做Web标准) Web标准:是由w3c和其他标准化组织制定的一系列标准的集合, ...

  6. 常见网站CSS样式重置

    腾讯 1 2 3 4 5 6 7 8 9 body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea, ...

  7. css样式重置,不建议用通配符

    由于各个浏览器对css样式的默认样式不一致,所以有必要进行样式重置.在网上看到很多建议使用 *{margin:0;padding:0} 重置margin和padding.建议不这样子使用,原因主要是性 ...

  8. css样式重置(初始化)收集

    淘宝的样式初始化: body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fields ...

  9. 封装好通用的reset.css base.css 样式重置css文件

    一般是叫reset.css 我这边命名成base.css 哎呀无所谓…… @charset "UTF-8"; /*css reset*/ /*清除内外边距*/ body, h1, ...

随机推荐

  1. JavaSE_2_关键字

    1.介绍一下Syncronized锁,如果用这个关键字修饰一个静态方法,锁住了什么?如果修饰成员方法,锁住了什么? synchronized是Java中的关键字,是一种同步锁.它修饰的对象有以下四种: ...

  2. Paoding-Rose学习

    * HttpServletRequest.getContextPath 获取web程序root.如果是默认位置,返回””空串,否则返回 /根路径名 * rose是如何扫描到资源的 利用spring提供 ...

  3. 流媒体 5——MPEG声音

    1. 听觉系统的感知特性: MPEG声音的数据压缩和编码不是依据波形本身的相关性和模拟人的发音器官的特性,而是利用人的听觉系统的特性来达到压缩声音数据的目的,这种压缩编码称为感知声音编码. 许多科学工 ...

  4. System.FormatException: GUID 应包含带 4 个短划线的 32 位数(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)。解决办法

    查一下数据库的UID数据是否格式正确,如: 错误格式1: {E056BB36-D824-4106-A9C3-D8D8B9ADC1C 错误格式2: E056BB36-D824-4106-A9C3-D8D ...

  5. 2018.10.03 NOIP+ 模拟赛 解题报告

    得分: \(30+5+0=35\)(考得真不咋滴) \(T1\):奥义商店(点此看题面) 以为很简单,对着这题想了一个多小时,最后果断打了个暴力交了... ... 看完题解发现其实也不是很难. 对于\ ...

  6. centos 7 虚拟机启用网卡

    1.vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 2.编辑默认网卡配置文件,将ONBOOT由no改为yes,编辑完成后,按ESC回至命令模板,输入&qu ...

  7. axiospost请求向后端提交数据

    Axios向后端提交数据容易接收不到原因是传参方式是request payload,参数格式是json,而并非用的是form传参,所以在后台用接收form数据的方式接收参数就接收不到了.post表单请 ...

  8. iphone丢失或忘记锁屏密码

    1.首先,我们要保证手机资料已经备份到iColud或者电脑(不想要恢复备份的可跳过该步骤) 2.保证,手机的  设置 → iCloud 处于打开状态: 3.手机的查找iphone软件登录了iColud ...

  9. nodejs 用户登录密码md5加密

    jade文件 div.login ul.inp-content  li span= '用户名:' input.ui-input1#input1(placeholder='请输入手机号')  li sp ...

  10. 牛客小白月赛5 I 区间 (interval) 【前缀和】

    链接:https://www.nowcoder.com/acm/contest/135/I 题目描述 Apojacsleam喜欢数组. 他现在有一个n个元素的数组a,而他要对a[L]-a[R]进行M次 ...