Two simple HTML examples:
<p>
<i>Some text</i>
</p>
<p>Here's a paragraph that has <i>some text</i>, and then some more</p>
When using CSS, this selects the <i>'s in both cases:
p > i {
border: 1px solid red;
}
> targets every <i> within every <p>.
What I'm looking for is a way to only target the <i>'s that immediately follow upon the <p>, in other words, that targets the <i> in the first example but not in the second. Kind of in a way that + selects adjacent siblings, but for adjacent children. Is this possible?
I looked into jQuery's only-child selector, but this also targets the <i>'s in both examples, since the text ("here's a paragraph...") isn't considered a child.