Skip to content

Instantly share code, notes, and snippets.

@swainet
Last active December 17, 2015 15:38
Show Gist options
  • Save swainet/5632824 to your computer and use it in GitHub Desktop.
Save swainet/5632824 to your computer and use it in GitHub Desktop.
CSS for Mobile
body {
-webkit-touch-callout: none; /*当手指按住(Touch hold)某个可点击的DOM节点时,禁止呼出操作面板,比如链接。*/
-webkit-user-select: none; /*无法选择文本*/
-ms-touch-select: none; /*WP8 实测无效果,理论作用同上*/
-webkit-tap-highlight-color: transparent; /*点击链接高亮的时候设置颜色为透明*/
-ms-touch-action: none; /*WP8 作用同上*/
/*WP8 还可以通过 <meta name="msapplication-tap-highlight" content="no" /> 实现*/
}
@media only screen and (max-width: 480px) {
/* small screen styles */
}
@media only screen and (min-width: 481px) {
/* large screen styles */
}
/* 非高速网络背景图继承 .ui-sd 标清*/
@media (-webkit-min-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(min--moz-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5) {
/* high resolution styles 高速Retina设备继承 .ui-hd 高清*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment