目录
  1. 1. -webkit-tap-highlight-color
    1. 1.1. 点击高亮效果
    2. 1.2. 取消点击高亮
移动端点击高亮的实现

-webkit-tap-highlight-color

点击高亮效果

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
<title>Title</title>
<style>
a {
display: block;
width: 100px;
height: 100px;
/*轻击 轻触*/
-webkit-tap-highlight-color: bisque;

}
</style>
</head>

<body>
<a href="javascript:;">22</a>
</body>

</html>

高亮在移动端默认是存在的,默认颜色是浅灰色

取消点击高亮

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
<title>Title</title>
<style>
a {
display: block;
width: 100px;
height: 100px
-webkit-tap-highlight-color: transparent; - /*tap-highlight-color: transparent;*/
}
</style>
</head>

<body>
<a href="javascript:;">22</a>
</body>

</html>

文章作者: Jachie Xie
文章链接: https://xjc5772.github.io/2020-08/02/%E5%AD%A6%E4%B9%A0/%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A0/%E7%A7%BB%E5%8A%A8Web/%E7%A7%BB%E5%8A%A8%E7%AB%AF%E7%82%B9%E5%87%BB%E9%AB%98%E4%BA%AE%E7%9A%84%E5%AE%9E%E7%8E%B0/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 XJC&Blog
打赏
  • 微信
  • 支付宝

评论