手机网页点击后出现蓝色的框解决方案

  在手机网页中点击某一个链接或是文本框后通常会在上面出现一个蓝色的透明的框(不同手机颜色有差别)。在网页中可以使用一个css修改这个框的颜色。

  

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

  上述代码中设定颜色为白色,透明度为0。应用之后页面上点击后就看不到原来的那个框了。

  如果需要加到所有元素上就是:

  

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

 

 

以下是描述该问题的原文:

In an HTML 5 site a user, who's surfing through a mobile device, clicks a link.
The browser draws a box (rectangle) as a feedback (in addition to a sound).
Browser might mean Android 2.3's stock browser, or Opera Mobile.

I'd like to avoid this (blue) box. At least for iPhone and Android based devices. Any idea?

本文原文链接:http://www.cnblogs.com/aser1989/p/4286489.html

posted @ 2015-03-07 15:14  Hook_LiFe  阅读(788)  评论(0编辑  收藏  举报