Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS "inner-html" technique? [duplicate]

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>

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;
}

I don't want to use JavaScript's innerHTML because I have no access to the javascript parts of the admin.

Any help is much appreciated!

like image 220
randmath Avatar asked Mar 26 '13 02:03

randmath


2 Answers

With pure CSS, that’s impossible.

like image 62
Marat Tanalin Avatar answered Oct 05 '22 01:10

Marat Tanalin


This is not possible using CSS. You can, however, do it using jQuery. Why not just add a class to the desired h1 tags?

like image 35
JQM Rookie Avatar answered Oct 05 '22 01:10

JQM Rookie