for my site with user-generated content, I would like to add drop caps but only if the p
element is first child of article
(for example).
I tried various combinations of first-child
along with :is
but couldn't get this to work.
For example with this markup:
<article>
<h2>Heading</h2>
<p>Text..</p>
</article>
I don't want the drop cap to appear, because there is the heading already.
But with this:
<article>
<p>Text.. (this should start with drop cap)</p>
<p>Text..</p>
</article>
I want to have drop cap for the first letter.
Is this possible to do via CSS only?
There's also a case where the first p
contains just img
due to Markdown parser, but I guess there is not much I can do about that.