美文网首页
取消a标签在移动端点击时的背景颜色

取消a标签在移动端点击时的背景颜色

作者: 喵呜Yuri | 来源:发表于2018-06-27 14:23 被阅读40次

    一、取消a标签在移动端点击时的蓝色

    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    -webkit-user-select: none;
    -moz-user-focus: none;
    -moz-user-select: none;
    

    二、使用图片作为a标签的点击按钮时,当触发touchstart的时候,往往会有一个灰色的背景

    a,a:hover,a:active,a:visited,a:link,a:focus{
        -webkit-tap-highlight-color:rgba(0,0,0,0);
        -webkit-tap-highlight-color: transparent;
        outline:none;
        background: none;
        text-decoration: none;
    }
    

    三、改变选中内容的背景颜色

    ::selection { 
        background: #FFF; 
        color: #333; 
    } 
    ::-moz-selection { 
        background: #FFF; 
        color: #333; 
    } 
    ::-webkit-selection { 
        background: #FFF; 
        color: #333; 
    } 
    

    四、去除ios input框点击时的灰色背景

    -webkit-tap-highlight-color:rgba(0,0,0,0);
    

    相关文章

      网友评论

          本文标题:取消a标签在移动端点击时的背景颜色

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