P粉4638111002023-08-23 10:14:27
Just execute:
ul.saft .textSlide {
This will achieve the functionality you require
P粉5494120382023-08-23 00:34:30
Just use the CSS descendant selector (one space) between the parent element and the child element:
ul.saft div.textSlide { /* CSS规则 */ }
* {
margin: 0;
padding: 0
}
li {
list-style-type: none;
}
ul.saft div.textSlide {
background-color: #f90;
font-weight: #000;
}
<ul class="saft">
<li>
<div class="textSlide">在textSlide类元素中的一些文本</div>
</li>
</ul>
<div class="textSlide">更多文本,也在textSlide元素中</div>