1.小三角,通过给一个div设置足够大的边框,让它的上边框,右边框,左边框,的背景颜色设置成透明的,来实现,如下:
<!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.a标签的移动端问题:
1》当再点击a标签的时候,它会有默认的背景颜色,解决办法
1 -webkit-tap-highlight-color:transparent;
2》当点击时可能会出现下划线,解决方法
1 text-decoration: none; //或者2 3 border: none;//或者4 5 outline:none;
3>当鼠标放上去时显出下划线,解决办法;
a:hover{ text-decoration:none; }
a标签是一个行内标签,如果要设置它的宽高或多个样式可通过display:block;将其变为块级标签。
以上就是背景颜色设置成透明实例教程的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号