How to do element selection inside another element?
P粉590929392
2023-08-22 11:08:56
<p>I have a question about CSS selectors. When a <code><div></code> with a specific class name is inside a <code><ul></code> with a class name <code>saft</code> How should I choose it? This CSS class is used elsewhere and I don't want to change the style everywhere. </p>
<pre class="brush:php;toolbar:false;"><div id="floater">
<ul class="saft">
<li><div class="textSlide"></li>
</ul>
</div></pre>
Just execute:
ul.saft .textSlide {
This will achieve the functionality you require
Just use the CSS descendant selector (one space) between the parent element and the child element: