-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathm-normalize.css
More file actions
344 lines (309 loc) · 6.67 KB
/
Copy pathm-normalize.css
File metadata and controls
344 lines (309 loc) · 6.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
@charset "utf-8";
/**
* @file: m-normalize.css V1.0.0
* @author: 小天同学
* @update: 2016-01-26 16:56:29;
* @copyright: 基于 Neat.css | MIT License
*/
/**
* m-normalize.css 解决的问题
* 基于目前移动端web开发主要做以下几点:
* 1.解决BUG,移动端浏览器的BUG和app中webview的bug;
* 2.统一效果,不盲目reset;
* 3.放弃部分PC浏览器的兼容;
* 4.充分考虑响应式和webapp开发;
* 5.考虑移动设备。
*/
/*
移除非必要默认值
-------------------------------------------------------------------------- */
/**
* 移除默认的margin,padding值
*/
body, div, dl, dd, ul, ol, h1, h2, h3, h4, h5, h6, pre, p, blockquote, hr,
form, fieldset, legend, input, textarea, optgroup, select,
article, aside, details,figcaption,figure,footer,header,hgroup, menu,nav,section
table, thead, tbody, tfoot, th, tr, td {
margin: 0;
padding: 0;
}
/**
* 去除列表样式
*/
ul, ol {
list-style:none;
}
/*
链接
-------------------------------------------------------------------------- */
/**
* 去除点击链接时的灰色背景
*/
a {
background-color: transparent;
}
/**
* 去除链接默认的下划线
*/
a {
text-decoration: none;
}
/**
* 去掉点击时的焦点框,同时保证使用键盘可以显示焦点框
*/
a:active,
a:hover {
outline: 0 none;
}
/*
字体和排版
-------------------------------------------------------------------------- */
/**
* 1.防止 iOS 横屏字号放大,同时保证在PC上 zoom 功能正常
*/
html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
text-size-adjust: 100%;
/* 1 */
}
/**
各系统默认字体
*ios {
中文【Heiti SC】
英文【 Helvetica】
数字【Helvetica Neue】
}
*android{
中文【Droid Sans Fallback】
英文数字【Droid Sans/Roboto】
}
*windows{
中文【微软雅黑】(\5FAE\8F6F\96C5\9ED1)
英文数字【Segoe】
}
*Linux{
中文【文泉驿微米黑】(wenquanyi micro hei)
}
*/
/**
* 中文优先使用冬青黑体简体(OS X)、微软雅黑(Windows)和文泉驿微米黑(Linux)
* 西文使用 Helvetica
* 1. 防止元素中「font-family」不能继承
* 2. 西文字体和 OS X 字体写在前面
*/
body,
button, input, select, textarea {
font-family: 'helvetica neue',Helvetica,'Droid Sans',Roboto,Segoe,'Heiti SC',stheiti,'Droid Sans Fallback','wenquanyi micro hei',\5FAE\8F6F\96C5\9ED1,\5B8B\4F53,sans-serif;
}
/**
* 统一修正设置为粗体
*/
b,
strong {
font-weight: bold;
}
/**
* 修正没有样式的问题
*/
dfn {
font-style: italic;
}
/**
* 修正浏览器之间的差异
*/
hr {
-webkit-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* 防止所有浏览器中的<sub>和<sup>影响行高
* http://jsbin.com/usoyal/1/edit
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/*
嵌入元素
-------------------------------------------------------------------------- */
/**
* 1. 去除a 内部 img 元素默认的边框
* 2. 防止 img 指定「height」时图片高度不能按照宽度等比缩放,导致图片变形
* 3. 让图片支持响应式
* 4. 去除现代浏览器图片底部的空隙
*/
img {
border: 0 none;
/* 1 */
height: auto;
/* 2 */
max-width: 100%;
/* 3 */
vertical-align: top;
/* 4 */
}
/**
* 修复 IE9/10/11 中「overflow」不隐藏的问题
*/
svg:not(:root) {
overflow: hidden;
}
/*
HTML5元素
-------------------------------------------------------------------------- */
/**
* 修正未定义为「block」的元素
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. 修正未定义为「inline-block」的元素
* 2. 修正 Chrome、Firefox、Opera 中 「progress」元素 vertical-align 默认值不一致
*/
audio,
canvas,
video,
progress {
display: inline-block;
/* 1 */
vertical-align: baseline;
/* 2 */
}
/**
* 1.防止现代浏览器将没有「controls」属性的 「audio」元素显示出来
* 2.去掉 iOS 5 中多余的高度
*/
audio:not([controls]) {
display: none;
/* 1 */
height: 0;
/* 2 */
}
/*
表单
-------------------------------------------------------------------------- */
/**
* 1. 修正文字不换行的问题
*/
legend {
white-space: normal;
/* 1 */
}
/**
* 1. 修正所有浏览器中字体不继承的问题
* 2. 修正所有浏览器中字号不继承的问题
* 3. 修正 Firefox 3+, Safari5 和 Chrome 中外边距不同的问题
* 4. 改善在所有浏览器下的垂直对齐方式
*/
button,
input,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 2 */
margin: 0;
/* 3 */
vertical-align: baseline;
/* 4 */
*vertical-align: middle;
/* 4 */
}
/**
* 统一各浏览器「text-transform」不会继承的问题
*/
button,
select {
text-transform: none;
}
/* 去除iPhone中默认的input样式 */
input[type="submit"],
input[type="reset"],
input[type="button"],
input{-webkit-appearance:none; resize: none;}
/**
* 1. 避免 Android 4.0.* 中的 WebKit bug ,该bug会破坏原生的
「audio」 和「video」的控制器
* 2. 更正 iOS 中无法设置可点击的「input」的问题
* 3. 统一其他类型的「input」的光标样式
*/
button,
html input[type="button"], input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
/* 2 */
cursor: pointer;
/* 3 */
}
/**
* 1. 修正 Safari 5 和 Chrome 中「appearance」被设置为「searchfield」的问题
* 2. 修正 Safari 5 和 Chrome 中「box-sizing」被设置为 「border-box」的问题
*/
input[type="search"] {
-webkit-appearance: textfield;
/* 1 */
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
/**
* 1.移除 OS X 中 Safari5 和 Chrome 搜索框内侧的左边距
* 2.如果需要隐藏清除按钮需要加上
input[type="search"]::-webkit-search-cancel-button
*/
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 修正 Chrome 中 input [type="number"] 在特定高度和 font-size 时,
* 下面一个箭头光标变成「cursor: text」
* @demo: http://jsfiddle.net/FFXEc/
* 动画演示:http://gtms04.alicdn.com/tps/i4/T18kd8FCtaXXc_FhcF-330-350.gif
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. 移除 IE6-11 中默认的垂直滚动条
* 2. 禁止水平拖动,防止破坏布局
*/
textarea {
overflow: auto;
/* 1 */
resize: vertical;
/* 2 */
}
/*
表单
-------------------------------------------------------------------------- */
/**
* 合并单元格边框
*/
table {
border-collapse: collapse;
border-spacing: 0;
}