美文网首页
H5移动端开发记录

H5移动端开发记录

作者: 搞个毛线哟 | 来源:发表于2019-05-22 22:55 被阅读0次

    常用的meta标签

    <!--定义文档与设备的缩放比,禁止屏幕缩放。-->

    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">

    <!--iphone的私有标签,允许全屏浏览。-->

    <meta content="yes" name="apple-mobile-web-app-capable">

    <!--iphone的私有标签,iphone顶端状态条的样式。-->

    <meta content="black" name="apple-mobile-web-app-status-bar-style">

    <!--禁止数字自动识别为电话号码,这个比较有用,因为一串数字在iphone上会显示成蓝色,样式加成别的颜色也是不生效的。-->

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

    <!--禁止email识别-->

    <meta content="email=no" name="format-detection">


    user-select:none,禁止选中,复制文本。


    -webkit-appearance:none,去除ios中form元素的默认样式,比如input,button等。


    -webkit-tap-highlight-color,在ios上,当你点击一个链接或是一个javascript定义的可点击元素时,会出现一个半透明的灰色背景,可以通过这个属性设置为任何颜色,比如去掉则可设置为transparent。


     -webkit-text-size-adjust,定义字体的缩放,常设置为none。


    在ios上,:active失效,需要在元素上绑定事件ontouchstart,为空就可以。


    ios固定定位有Bug时,检查html,body是不是设置了overflow-x:hidden。


    ios对input键盘事件支持不是很好,使用input事件代替。


    input的placeholder属性会使文本位置偏上,line-height:normal(移动端),line-height:input框的高度(pc)

    相关文章

      网友评论

          本文标题:H5移动端开发记录

          本文链接:https://www.haomeiwen.com/subject/oerqfqtx.html