How to remove the background color generated by the element when clicked on the mobile side in CSS
In this article, the editor introduces in detail "how to remove the background color generated by the element when clicking on the mobile side in CSS". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to remove the background color generated by the element when clicking on the mobile side in CSS" can help you solve your doubts.
Add the following code to the css style of the element that you click to produce the background color:
-webkit-tap-highlight-color: transparent
Ps: let's take a look at the background color when css cancels the a tag when it is clicked on the mobile
Cancel the blue color of the a tag when clicked on the mobile side
-webkit-tap-highlight-color: rgba (255,255,255,0);-webkit-user-select: none;-moz-user-focus: none;-moz-user-select: none
Second, when using the picture as the click button of the a tag, there is often a gray background when the touchstart is triggered.
Webkit-tap-highlight-color: transparent; outline:none; background: none; text-decoration: none;}
Third, 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 the ios input box is clicked
-webkit-tap-highlight-color:rgba; read here, this article "how to remove the background color generated by mobile clicks in CSS" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it. If you want to learn more about related articles, please follow the industry information channel.