Prevent certain HTML elements from being copied

后端 未结 1 1282
暗喜
暗喜 2021-01-20 16:19

I\'m not entirely sure how to go about researching this idea. I\'m sure it\'s been done, but I\'m having an issue articulating it for an effective Google search.

I h

相关标签:
1条回答
  • 2021-01-20 17:00

    You can use the user-select property to disable text highlighting on the <h1> and <span>

    h1, span {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
     user-select: none;
    }
    

    http://jsfiddle.net/C6KWy/

    0 讨论(0)
提交回复
热议问题