css – 如何在子元素上覆盖“-moz-user-select:none;”?

这个问题 CSS rule to disable text selection highlighting显示了如何防止元素上的文本选择.一旦你阻止了选择,你如何才能选择一个特定的子元素?例如
<div class="no-select">
    <p>some text that cannot be selected</p>
    <p class="select">some text that can be selected</p>
    <p>some text that cannot be selected</p>
</div>

table.no-select{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

td.select{-webkit-touch-callout: all !important;
-webkit-user-select: all !important;
-khtml-user-select: all !important;
-moz-user-select: all !important;
-ms-user-select: all !important;
user-select: all !important;
}

上面的.no-select规则起作用,但是我在一个.select规则下的尝试不行,这样做的正确方法是什么?

解决方法

尝试-moz-user-select:文本而不是全部.

作为未来的参考,每当关心css规则的可能值时,请检查像MDN这样的站点.

Here用户选择的MDN链接.

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效