How do i select text inside this
As you can see inside that
How do i select text inside this
As you can see inside that
Text nodes can't be selected with CSS. You have to give some rules to the li, and then give rules to the div inside the li to override the styles that it gets from its parent, or wrap the text on some other element like a span.
You can't select only that text. So style the div too:
ul,
li div {
color: black;
}
li {
color: green;
}
<ul>
<li>
Text
<div>Div Text</div>
</li>
<li>
Text
<div>Div Text</div>
</li>
</ul>
With the regular CSS methods you can't do that.
I suggest to put a <span>
around it and assig a class to it which you can style.