CSS& quot; inner-html& quot;技术? [英] CSS "inner-html" technique?
本文介绍了CSS& quot; inner-html& quot;技术?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否有一种方法可以根据包含的单词查询元素.所以,如果我有:
I was wondering if there was a way to query elements according to the word it contains. So, if I have:
<div id="globalPageHeader">
<h1>Home</h1>
</div>
我希望其中任何带有单词 Home
的 #globalPageHeader h1
都具有 none 的
display
属性代码>.
I want any #globalPageHeader h1
that has the word Home
in it, to have a display
property of none
.
很明显,这个例子不起作用,但是我想知道是否有类似的东西:
Obviously this example wouldn't work, but I was wondering if there's something like it:
#globalPageHeader h1(innerHTML == "Home") {
display: none;
}
我不想使用JavaScript的 innerHTML
,因为我无权访问管理员的javascript部分.
I don't want to use JavaScript's innerHTML
because I have no access to the javascript parts of the admin.
非常感谢您的帮助!
推荐答案
使用纯CSS,这是不可能的.
With pure CSS, that’s impossible.
这篇关于CSS& quot; inner-html& quot;技术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文