CSS3 Modify and remove the background box that appears on the mobile-click event

Source: Internet
Author: User

One of the great benefits of mobile development is that you can simply display the page in some advanced browsers such as Firefox, regardless of the annoying IE browser compatibility.
Recently in the writing of some mobile page, just today encountered such a magical CSS features. That's tap-highlight-color.

This effect is implemented when the mobile side click on a place, such as a button or hyperlink, the system will default to add some gray background and some highlighting effect. But sometimes we don't want these effects. and want to click on the time to realize the feeling of the unknown,, this time will be used to tap-highlight-color. Just add a CSS style to the clicked element, as follows:
-webkit-tap-highlight-color:rgba (0,0,0,0);

This style can also set the background color of the click: for example:

-webkit-tap-highlight-color:rgba (240,240,240,0.7);

You can change the color of the background frame when the element is clicked.

There's also a way to set the color of the selected text.

The background color is usually blue when we select text. We can use the following style to set the style of the page's selection:

:: Selection {background: #FFF; color: #333;}

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

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

If you want to remove the color of the selection, set the background to none.

CSS3 Modify and remove the background box that appears on the mobile-click event

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.