您的位置:首页 > Web前端

前端常用的代码片段

2016-04-07 14:52 316 查看
1.屏蔽页面中自动将数字转为手机号,并带下划线

<meta name="format-detection" content="telephone=no" />

要解开,只需"telephone=yes"即可

<!-- iOS 图标 begin -->
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-57x57-precomposed.png"/>
<!-- iPhone 和 iTouch,默认 57x57 像素,必须有 -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114x114-precomposed.png"/>
<!-- Retina iPhone 和 Retina iTouch,114x114 像素,可以没有,但推荐有 -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144x144-precomposed.png"/>
<!-- Retina iPad,144x144 像素,可以没有,但推荐有 -->
<!-- iOS 图标 end -->


2.meta标签

将所有设备的宽度统一定位720px,这样的好处是可以稳定住所有设备适配,单位也可以直接用px,但如果需要做二维码识别的,就慎用。因为这种模式下,二维码图总是识别不到,或者有图片需要长按保存之类的,也慎用。
<meta name="viewport" content="target-densitydpi=device-dpi,width=720,user-scalable=no">

经常用的,不多说了
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: