azl397985856 / fe-interview

宇宙最强的前端面试指南 (https://lucifer.ren/fe-interview)
Apache License 2.0
2.84k stars 260 forks source link

【每日一题】- 2020-01-16 - 怎么实现无法选中的效果 #96

Closed azl397985856 closed 4 years ago

azl397985856 commented 4 years ago

如下实现 unselectable ,使之无法选中

<p>You can select me.</p>
<p class="unselectable">You can't select me!</p>

扩展:

azl397985856 commented 4 years ago

for css:

select: none