CSS“单词"选择器? [英] CSS "word" selector?
本文介绍了CSS“单词"选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过CSS选择和设置特定字词的样式? 案例示例:
Is it possible to select and style a specific word via css? Example case:
<div>Roses are red violets are blue. This is red that is blue.</div>
和某种类型的样式会使该句子中的所有red
单词变为红色;并且该句子中的所有blue
单词均为蓝色.
and a certain type of styling would make all red
words in that sentence, red; and all blue
words in that sentence blue.
我找到了该页面,该页面以某种方式起作用.不确定其工作方式(某些元素都是彩色的-如何?) http://www.regexr.com/
I've found this page, that works somehow. Not sure how it works (vertain elements are colored -- how?) http://www.regexr.com/
推荐答案
否,这不可能.您必须为此使用javascript.
No it's not possible. You have to use javascript for this.
这篇关于CSS“单词"选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文