How to cancel the background color of the a tag when it is clicked in H5

How to cancel the background color of the a tag when it is clicked in H5

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

a {
 -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);

5. Remove the blue background when the picture is selected in iOS

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

This is the end of this article about canceling the background color of the a label when it is clicked. For more relevant a label background color content, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  The connection between JavaScript constructors and prototypes

>>:  Use CSS to set the width of INPUT in TD

Recommend

Example of implementing the skeleton screen of WeChat applet

Table of contents What is a skeleton screen How t...

JavaScript CollectGarbage Function Example

First, let's look at an example of memory rel...

Detailed graphic tutorial on installing Ubuntu 20.04 dual system on Windows 10

win10 + Ubuntu 20.04 LTS dual system installation...

About MySQL 8.0.13 zip package installation method

MySQL 8.0.13 has a data folder by default. This f...

Pitfalls and solutions encountered in MySQL timestamp comparison query

Table of contents Pitfalls encountered in timesta...

js to realize a simple advertising window

This article shares the specific code of js to im...

Analysis of MySQL general query log and slow query log

The logs in MySQL include: error log, binary log,...

Steps for IDEA to integrate Docker to achieve remote deployment

1. Enable remote access to the docker server Log ...

How to set up FTP server in CentOS7

FTP is mainly used for file transfer, and is gene...

Example of downloading files with vue+django

Table of contents 1. Overview 2. Django Project 3...

25 Vue Tips You Must Know

Table of contents 1. Limit props to type lists 2....

Sample code for generating QR code using js

Some time ago, the project needed to develop the ...

Example code for implementing fullpage.js full-screen scrolling effect with CSS

When I was studying CSS recently, I found that I ...