I need to match pre
when it is under long
class, like in here:
<div class="long highlight-text">
<div class="highlight">
<pre>
some code
</pre>
</div>
</div>
I tried: long.highlight.pre
-- but doesn't seem to be working.
I need to match pre
when it is under long
class, like in here:
<div class="long highlight-text">
<div class="highlight">
<pre>
some code
</pre>
</div>
</div>
I tried: long.highlight.pre
-- but doesn't seem to be working.
As from your test you seem to also want to include .highlight
in the selector, I'd suggest this one :
.long .highlight pre
or if you just want to "match pre when it is under long class" :
.long pre
A space in a b
means b
is a descendant of a
.
You need the ␣ combinator
selector, which refers to all matching descendants (not necessarily direct childs):
.long pre
See, also, this page describing CSS selectors
or the official CSS Selectors Reference.
You should use: .long pre
. And read http://www.w3schools.com/css3/default.asp for detail.