mobile 页面需要 rest css 吗?

2014-04-03 14:07:09 +08:00
 leohxj
我一般只是:

```css
* {
margin:0;
padding:0;
border:0;
outline:0;
vertical-align:baseline;
background:transparent;
-webkit-touch-callout:none;
-webkit-user-select:none;
-webkit-text-size-adjust:none;
}
```

normalize.css感觉太大了,有少一点的类normalize样式吗?
1677 次点击
所在节点    问与答
4 条回复
loading
2014-04-03 14:42:39 +08:00
自己根据用到的元素写一下,文件又小又好
Sivan
2014-04-03 15:04:56 +08:00
不想用 normalize 的话,你用的通配符这种也是可以的,不会影响效率,但是后面几行可以只加到 html 上。
flyingkid
2014-04-03 15:30:38 +08:00
直接把normalize.css下回来自己改进一下就行了。比如有些标签根本不会用到的,直接删除。
foru17
2014-04-03 15:31:37 +08:00
@charset "utf-8";

div,p,dl,dd,h1,h2,h3,h4,h5,h6,a,b,u,em,input,textarea,button,select,form,section,label,span,td,li,nav,footer,body,ul,i {
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0,0,0,0);
word-wrap: break-word;
word-break: break-all;
padding: 0;
margin: 0
}

ul,li,ol {
list-style: none
}

a {
text-decoration: none;
color: #333
}

a,img,button {
-webkit-touch-callout: none
}

a:focus,a:active,a:hover,input,button,textarea {
outline: 0
}

table {
border-collapse: collapse
}

body,td,input,textarea,option,select,button {
font-family: "微软雅黑",helvetica,arial;
font-size: 1em;
-webkit-text-size-adjust: none
}

body,td,h3 {
font-size: .95em;
-webkit-user-select: none
}

.clearfix:after {
content: '';
display: block;
overflow: hidden;
visibility: hidden;
clear: both
}

供参考

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/107104

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX