I'm having trouble selecting a particular em
element. I have a block which looks like this which I use for photos on my blog:
<p>
<em><img /></em>
<em>This is the element I'd like to select and style.</em>
</p>
I'm trying to use CSS to select the second em
element. I know I can use the adjacent sibling combinator: em + em
.
Unfortunately this also selects every other instance of two italicized groups of text, a situation which comes up fairly regularly (and which I'm currently preventing by putting empty blocks between adjacent groups of italicized text).
My suspicion is that this might be possible given the fact that one em
element always contains an img
element, but I'm not sure.
Without using classes or IDs (as this is originally written in markdown and processed by GitHub Pages), is there another way to select and style that second em
tag?
Not a duplicate: Were I trying to select the child of the first em
element, then yes, this would be a duplicate. But I'm trying to select the second em
element, and can't rely on selecting every single child em
with a p
element as its parent.