I am bit concerned, how can I add style to only immediate child and not after the some plain text.
Ex.
I have structure like: 1)
<div>
plain text lorm ipusm
<ul><li>test content</li></ul>
<ul><li>test content</li></ul>
</div>
If I add rule for ul should not apply. If I set background then it should not be applied here as it has some text before ul "plain txt lorm ipsum"
and 2)
<div>
<ul><li>test content</li></ul>
<ul><li>test content</li></ul>
</div>
If I add rule for ul should apply to this ul as there is not text before it.
I dont have any css selector, wants to apply style to ul immediate to div as in 2nd example not as in 1st. I mean in first ex. inside div there are some text and then ul. In that case style should not be applied and in 2nd ul is immediate to div, style should applied to only first ul.
I have tried div > ul:first-child
but it applicable in both the cases
In short, style should not apply to the ul if there is any text in between div and ul
` is the first child of the `` and not if there's any text between the two?
– j08691 Sep 07 '17 at 16:35