如何使用css自动选择页面上的单词

问题描述 投票:0回答:1

我正在使用revealjs并希望在我的幻灯片上自动选择/突出显示一些单词。

所以我定义了这个类:

.force-select {  
  -webkit-user-select: all;  /* Chrome 49+ */
  -moz-user-select: all;     /* Firefox 43+ */
  -ms-user-select: all;      /* No support yet */
  user-select: all;          /* Likely future */   
}

然后使用它像<span class="force-select"> word </span>但除非我点击这个词它没有得到自动选择。

任何想法如何自动选择?

html css reveal.js
1个回答
0
投票

user-select: all;属性用于“文本选择”是由一个 点击而不是双击,user-select:没有自动选择的值或突出显示'word'

© www.soinside.com 2019 - 2024. All rights reserved.