代码之家  ›  专栏  ›  技术社区  ›  Sergino

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

  •  0
  • Sergino  · 技术社区  · 7 年前

    所以我定义了这个类:

    .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>

    你知道如何自动选择吗?

    1 回复  |  直到 7 年前
        1
  •  0
  •   ascripter    7 年前

    user-select: all; 属性用于用一个
    单击而不是双击 user-select: 选择或突出显示“单词”

    推荐文章