Home > Web Front-end > HTML Tutorial > CSS3 removes the highlight box that appears when clicking the button on the mobile browser_html/css_WEB-ITnose

CSS3 removes the highlight box that appears when clicking the button on the mobile browser_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:41:10
Original
1376 people have browsed it

When browsing the web in a mobile browser at work, when you click on a button on the page or an element with a click event, a default highlight box will appear, which affects the overall sensory experience.

This can be solved with a simple css3 attribute: tap-highlight-color, preferably with the webkit browser prefix.


-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-tap-highlight-color: transparent; /* For some Androids,个人感觉是低版本的安卓,4.0以下 */  
Copy after login

If your large div contains many small divs of the same type, click on these small divs to trigger events. If you use event delegation to only bind the click event to the outer large div (so you only need to bind it once), then this attribute will be used. When you click on a small div, the entire large div will not appear. The feeling that the div is selected.

Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template