CSS removes the background color of elements generated when they are clicked on the mobile terminal (recommended)

CSS removes the background color of elements generated when they are clicked on the mobile terminal (recommended)

Add the following code to the CSS style of the element that generates the background color when clicking:

-webkit-tap-highlight-color: transparent;

ps: Let's take a look at the css to cancel the background color of the a tag when it is clicked on the mobile terminal

1. Cancel the blue color of the a tag when it is clicked on the mobile terminal

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

2. When using an image as the click button of the a tag, there is often a gray background when touchstart is triggered

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;
}

3. Change the background color of the selected content

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

4. Remove the gray background when clicking the ios input box

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

Summarize

The above is the CSS that I introduced to you to remove the background color of elements when clicking on the mobile terminal. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  Specific use of the autoindex module in the Nginx Http module series

>>:  vue.js Router nested routes

Recommend

Vendor Prefix: Why do we need a browser engine prefix?

What is the Vendor Prefix? Vendor prefix—Browser ...

MySQL Optimization: Cache Optimization (Continued)

There are caches everywhere inside MySQL. When I ...

Detailed explanation of the wonderful CSS attribute MASK

This article will introduce a very interesting at...

Research on Web Page Size

<br />According to statistics, the average s...

How to install PHP7.4 and Nginx on Centos

Prepare 1. Download the required installation pac...

Detailed steps for installing and configuring mysql 5.6.21

1. Overview MySQL version: 5.6.21 Download addres...

JavaScript to achieve product query function

This article example shares the specific code of ...

Automatically install the Linux system based on cobbler

1. Install components yum install epel-rpm-macros...

Linux kernel device driver advanced character device driver notes

/****************** * Advanced character device d...

Solution for Docker container not recognizing fonts such as Songti

Problem background: When using docker to deploy t...

Nginx's practical method for solving cross-domain problems

Separate the front and back ends and use nginx to...

Vue+axios sample code for uploading pictures and recognizing faces

Table of contents Axios Request Qs processing dat...

Detailed analysis of binlog_format mode and configuration in MySQL

There are three main ways of MySQL replication: S...