a,span做成按钮样式时,文字会被选中.加以下CSS可以让其不选中.测试三大浏览器都可以

.button {
    display: inline-block;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

  示例如下 选择时,选不中

 

按钮a 按钮span

 

不加时,可以选中

不加

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-12-30
  • 2021-07-16
  • 2021-11-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案