1. The small triangle is achieved by setting a large enough border for a div and setting its top border, right border, left border, and background color to transparent, as follows:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #demo { width: 0; height: 0; /*边框的宽20px*/ border-width: 20px; /*边框样式,实线*/ border-style: solid; /*边框颜色*/ border-color: transparent transparent red transparent; } </style> </head> <body> <!--小三角,transparent透明的,--> <div id="demo"> </div> </body> </html>
2. Problems with the mobile version of the a tag:
1》When you click the a tag, it will have a default background color. Solution
1 -webkit-tap-highlight-color:transparent;
2》Underline may appear when clicked, solution1 text-decoration: none; //或者2 3 border: none;//或者4 5 outline:none;
a:hover{ text-decoration:none; }
The above is the detailed content of Example tutorial on setting the background color to transparent. For more information, please follow other related articles on the PHP Chinese website!