normalize.css最新样式文件(中文翻译版)

  • 来自于GitHub上,附上链接normalize.css

  • 因为原版是英文所以翻译了下注释

  • 末尾添加了自己常用的样式文件(按需添加即可)

(附上代码,复制即可,麻烦点个赞谢了


/********************定义重置样式文件normalize.css***********************/
/****/
/*文档*/
/****/
html {
  font-family: sans-serif; /* 1 */
  line-height: 1.15; /* 2 */
  -ms-text-size-adjust: 100%; /* 3 */
  -webkit-text-size-adjust: 100%; /* 3 */
}
/****/
/*删除浏览器的默认边距*/
/****/
* {
	margin: 0;
	padding: 0;
}
/****/
/*在iE9当中添加正确的样式,ie9对新的h5标签的兼容*/
/****/
article,
aside,
footer,
header,
nav,
section {
  display: block;
}

/**
*请更正“section”和中“h1”元素的字体大小和边距
*Chrome、Firefox和Safari中的`article`上下文。
*/
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/*分组内容
========================================================================== */
/**
*在IE 9-中添加正确的显示。
*1。在IE中添加正确的显示。
*/
figcaption,
figure,
main { /* 1 */
  display: block;
}
/**
*在IE 8中加上正确的边距。
*/
figure {
  margin: 1em 40px;
}
/**
*1。在Firefox中添加正确的框大小。
*2。在边缘和IE中显示溢出。
*/

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}
/**
*1。更正所有浏览器中字体大小的继承和缩放。
*2。更正所有浏览器中的“em”字体大小。
*/

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}
/*文本级语义
========================================================================== */
/**
*1。删除IE 10中活动链接的灰色背景。
*2。在iOS 8+和Safari 8+中删除链接下划线中的空白。
*/
a {
  background-color: transparent; /* 1 */
  -webkit-text-decoration-skip: objects; /* 2 */
}
/**
*当焦点链接也处于活动状态或悬停状态时,删除它们的轮廓
*在所有浏览器中(固执己见)。
*/

a:active,
a:hover {
  outline-width: 0;
}

/**
*1。删除Firefox 39-中的底部边框。
*2。在Chrome、Edge、IE、Opera和Safari中添加正确的文本装饰。
*/
abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}
/**
*通过Safari 6中的下一个规则防止“bolder”的重复应用。
*/
b,
strong {
  font-weight: inherit;
}
/**
*1。更正所有浏览器中字体大小的继承和缩放。
*2。更正所有浏览器中的“em”字体大小。
*/
code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}
/**
*在Android4.3中添加正确的字体样式。
*/
dfn {
  font-style: italic;
}
/**
*在IE 9-中添加正确的背景和颜色。
*/

mark {
  background-color: #ff0;
  color: #000;
}
/**
*在所有浏览器中添加正确的字体大小。
*/
small {
  font-size: 80%;
}
/**
*防止“sub”和“sup”元素影响
*所有浏览器。
*/
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*嵌入内容
========================================================================== */
/**
*在IE 9-中添加正确的显示。
*/
audio,
video {
  display: inline-block;
}
/**
*在iOS 4-7中添加正确的显示。
*/

audio:not([controls]) {
  display: none;
  height: 0;
}
/**
*删除IE 10-中链接内的图像边框。
*/

img {
  border-style: none;
}
/**
*在IE中隐藏溢出。
*/
svg:not(:root) {
  overflow: hidden;
}
/*表格
========================================================================== */
/**
*1。在所有浏览器中更改字体样式(固执己见)。
*2。删除Firefox和Safari中的边距。
*/
button,
input,
optgroup,
select,
textarea {
  font-family: sans-serif; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}
/**
*在IE中显示溢出。
*1。显示边缘溢出。
*/

button,
input { /* 1 */
  overflow: visible;
}
/**
*删除Edge、Firefox和IE中文本转换的继承。
*1。删除Firefox中文本转换的继承。
*/
button,
select { /* 1 */
  text-transform: none;
}
/**
*1。防止(2)破坏本机“audio”和“video”的WebKit错误`
*Android 4中的控件。
*2。更正在iOS和Safari中无法设置可单击类型的样式。
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
  -webkit-appearance: button; /* 2 */
}
/**
*删除Firefox中的内边框和填充。
*/

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}
/**
*恢复先前规则未设置的焦点样式。
*/

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}
/**
*在所有浏览器中更改边框、边距和填充(自以为是)。
*/
fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}
/**
*1。更正边缘和IE中的文字环绕。
*2。更正IE中“fieldset”元素的颜色继承。
*3。去掉填充,这样开发人员在归零时不会被发现
*所有浏览器中的`fieldset`元素。
*/

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}
/**
*1。在IE 9-中添加正确的显示。
*2。在Chrome、Firefox和Opera中添加正确的垂直对齐方式。
*/

progress {
  display: inline-block; /* 1 */
  vertical-align: baseline; /* 2 */
}

/**
*删除IE中默认的垂直滚动条。
*/
textarea {
  overflow: auto;
}
/**
*1。在IE 10-中添加正确的盒子尺寸。
*2。拆下IE 10-中的衬垫。
*/

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}
/**
*更正Chrome中递增和递减按钮的光标样式。
*/

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}
/**
*1。纠正Chrome和Safari中的奇怪外观。
*2。更正Safari中的轮廓样式。
*/

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}
/**
*删除macOS上Chrome和Safari中的内部填充和取消按钮。
*/

[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}
/**
*1。更正在iOS和Safari中无法设置可单击类型的样式。
*2。在Safari中将字体属性更改为“inherit”。
*/
::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}
/*交互式
========================================================================== */
/*
*在IE 9-中添加正确的显示。
*1。在Edge、IE和Firefox中添加正确的显示。
*/
details, /* 1 */
menu {
  display: block;
}
/*
*在所有浏览器中添加正确的显示。
*/

summary {
  display: list-item;
}
/*编写脚本
========================================================================== */
/**
*在IE 9-中添加正确的显示。
*/

canvas {
  display: inline-block;
}
/**
*在IE中添加正确的显示。
*/

template {
  display: none;
}
/*隐藏的
========================================================================== */
/**
*在IE 10-中添加正确的显示。
*/

[hidden] {
  display: none;
}

/*自己新添加的样式文件*/

ul, ol {
	list-style: none;
}

input, button {
	outline: none;
	border: none;
}

a {
	text-decoration: none;
}

.clearfix::before,
.clearfix::after {
	content: "";
	height: 0;
	line-height: 0;
	display: block;
	visibility: hidden;
}

.clearfix::after {
	clear: both;
}

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值