Normalize.css做了哪些事情--看代码
博主说:本博客文章来源包括转载,翻译,原创,且在文章内均有标明。鼓励原创,支持创作共享,请勿用于商业用途,转载请注明文章链接。本文链接:http://www.kein.pw/?p=80
/*! normalize.css v2.1.2 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5新标签display属性定义
========================================================================== */
/**
* 为 IE 8/9定义新的块状元素.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
/**
*为 IE 8/9定义新的inline-block元素.
*/
audio,
canvas,
video {
display: inline-block;
}
/**
* 防止现代浏览器在显示audio的时候没有控制条
* 移除在iOS5设备中多出的高度
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* 修正IE 8/9不支持的属性
*/
[hidden] {
display: none;
}
/* ==========================================================================
Base
========================================================================== */
/**
* 1. 设置默认字体为 sans-serif.
* 2. 组织iOS方向变化后的字体调整,但不禁止用户缩放.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* 移除默认外边距.
*/
body {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
/**
* 统一所有浏览器的链接焦点虚线框.
*/
a:focus {
outline: thin dotted;
}
/**
*提升所有浏览器中链接焦点和鼠标划过后的可读性
*/
a:active,
a:hover {
outline: 0;
}
/* ==========================================================================
Typography
========================================================================== */
/**
* 统一h1在不同浏览器中具有不同的字号和外边距 Firefox 4+, Safari 5, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* 修正不支持的属性 IE 8/9, Safari 5, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* 修正b,strong的加粗样式为bold in Firefox 4+, Safari 5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* 修正不支持属性 in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/**
* 统一火狐与其它浏览器的样式
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* 修正不支持属性 in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* 修正奇葩字体设定 in Safari 5 and Chrome.
*/
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
/**
* 提升所有浏览器的可读性.
*/
pre {
white-space: pre-wrap;
}
/**
* 设置一致的样式.
*/
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
/**
* 统一所有浏览器字号.
*/
small {
font-size: 80%;
}
/**
*消除 `sub` 和`sup`对 `line-height` 的影响 all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* ==========================================================================
Embedded content
========================================================================== */
/**
*移除边框 in IE 8/9.
*/
img {
border: 0;
}
/**
*修正显示怪异 in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
/* ==========================================================================
Figures
========================================================================== */
/**
* 修正不支持属性 IE 8/9 and Safari 5.
*/
figure {
margin: 0;
}
/* ==========================================================================
Forms
========================================================================== */
/**
* 定义一致的边框,外边距,内边距 border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1.修正color没有继承 in IE 8/9.
* 2.移除内边距,防止属性归零时不出纰漏
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. 修正字体不能继承 in all browsers.
* 2.修正字号不能继承 in all browsers.
* 3. 统一不同的外边距 in Firefox 4+, Safari 5, and Chrome.
*/
button,
input,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 2 */
margin: 0; /* 3 */
}
/**
* 修正 Firefox 4+ 默认的!important设置
*/
button,
input {
line-height: normal;
}
/**
* 修正`button` 和`select`的text-transform属性遗传不一致
* 所有其他form控制元素不继承 `text-transform` 的值.
* 修正 `button`样式遗传 in Chrome, Safari 5+, and IE 8+.
* 修正`select` 样式遗传 in Firefox 4+ and Opera.
*/
button,
select {
text-transform: none;
}
/**
* 1. 避开 WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. 修正iOs中无法给可点击的input添加样式的问题
* 3. 提高type属性为image的input元素鼠标指针的可用性和一致性
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* 重置不可操作元素的默认鼠标指针
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* 1.修正type属性为 `content-box`的box-sizing样式 in IE 8/9.
* 2. 移除多余的padding in IE 8/9.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. 修正搜索框的 `appearance` 属性in Safari 5 and Chrome.
* 2.修正 `box-sizing` 属性 `border-box` in Safari 5 and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
*移除内边距和取消搜索按钮in Safari 5 and Chrome
* on OS X.
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 移除边框和内边距in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* 1.移除默认的竖向滚动条 in IE 8/9.
* 2.提高可读性和对齐 in all browsers.
*/
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
/* ==========================================================================
Tables
========================================================================== */
/**
* 移除大多数单元格中的的空格.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
Normalize.css做了哪些事情--看代码的更多相关文章
- Normalize.css 介绍与源码解读
开始 Normalize.css 是一个可定制的 CSS 文件,使浏览器呈现的所有元素,更一致和符合现代标准;是在现代浏览器环境下对于CSS reset的替代. 它正是针对只需要统一的元素样式.该项目 ...
- 剥开比原看代码08:比原的Dashboard是怎么做出来的?
作者:freewind 比原项目仓库: Github地址:https://github.com/Bytom/bytom Gitee地址:https://gitee.com/BytomBlockchai ...
- Normalize.css的使用及下载
Normalize.css 只是一个很小的CSS文件,但它在默认的HTML元素样式上提供了跨浏览器的高度一致性.相比于传统的CSS reset,Normalize.css是一种现代的.为HTML5准备 ...
- [转载]来,让我们谈一谈Normalize.css
来源 : http://segmentfault.com/a/1190000002239676 ---------------------------------------------------- ...
- Normalize.css 初识
一. 用来干嘛的 一个现代的.准备好了支持 HTML5 技术,并且要替代 CSS Reset 处理样式的理念. Normalize.css 使浏览器渲染所有元素更加一致,并且符合现代标准.它只是针对那 ...
- Normalize.css的使用(重置表)
本文译自Normalize.css官网: http://nicolasgallagher.com/about-normalize-css/ Normalize.css 只是一个很小的CSS文件,但它在 ...
- 来,让我们谈一谈Normalize.css
本文译自 http://nicolasgallagher.com/about-normalize-css/最初发布于我的博客:http://jerryzou.com/posts/aboutNormal ...
- Normalize.css介绍,作用,使用方法
介绍 Normalize.css 是一个很小的CSS文件(V5.0.0版本大小8KB),但它在默认的HTML元素样式上提供了跨浏览器的高度一致性.相比于传统的CSS reset,Normalize.c ...
- [转载] ul li css 做横向菜单
原文地址: http://www.cnblogs.com/amylis_chen/archive/2011/09/24/2188398.html 第一步:建立一个无序列表 我们先建立一个无序列表,来建 ...
随机推荐
- KVM工具libvirt、virsh、virt-manager的简单介绍
KVM虚拟化中libvirt是目前使用最为广泛的对KVM虚拟机进行管理的工具和应用程序接口,而且一些常用的虚拟机管理工具(virsh.virt-install.virt-manager等)和云计算框架 ...
- Word中将图表变为表格
一定要先拷贝了图表,否则第二张图片没那个像是,只有最后一个,这样的做的目的是减少查重. 还有就是把部分文字放入Mathtype,查不出来.
- (救星啊)im-switch -s ibus错误:Error: no configuration file "ibus" exists.
转自:http://www.cnblogs.com/csulennon/p/4194902.html 在虚拟机上安装Ubuntu14.04 后安装ibus输入法,万万没想到在切换输入法的时候居然出错了 ...
- Tesseract训练中文字体识别
注:目前仅说明windows下的情况 前言 网上已经有大量的tesseract的识别教程,但是主要有两个缺点: 大多数比较老,有部分内容已经不适用. 大部分只是就英文的训练进行探索,很少针对中文的训练 ...
- Android 花钱 划动手指每天一元钱
花钱(英文ColorMoney)是由上海花动传媒开发的一款免费的应用程序,现支持Android操作系统.安装花钱app后,用户将获得全新的手机锁屏背景图,其中包含各种有趣.唯美的壁纸类图片,亦包含应用 ...
- iOS:键盘弹出和收起的通知使用
介绍:不论是UITextField,还是UITextView,使用它们输入文字时都是有键盘的弹出,此时可能会挡住我们创建的一分部其他视图,此时,就需要根据键盘的高度将我们被隐藏的部分View做向上或者 ...
- poj3592 Instantaneous Transference tarjan缩点+建图
//给一个n*m的地图.坦克从(0 , 0)開始走 //#表示墙不能走,*表示传送门能够传送到指定地方,能够选择也能够选择不传送 //数字表示该格的矿石数, //坦克从(0,0)開始走.仅仅能往右和往 ...
- Maven Web项目配置Mybatis出现SqlSessionFactory错误的解决方案
一.错误现象 严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Er ...
- dubbo forbid 注意的几种方式
1.检查所调用的项目模块是否起来了 2.如果起来后,检查该模块配置是否正确 3.服务端起来后与管理端的项目内容不一致(比如服务端增加了东西,管理端没有更新)
- EffectiveJava(29)优先考虑类型安全的异构容器
当你的泛型集合需要更多的灵活性,你可以将键进行参数化而不是将容器进行参数化.然后将参数化的键提交给容器,来插入或者获取值.用泛型系统来确保值得类型与它的键相符. 我们创建一个Favorite类来模拟这 ...