I have a div that contains a few sentences with the paragraph tag (p). I want the styling to target the P tag, the last child, and the first child. How do I do it with relative styling?
Since :first-child isn’t available as a pseudo class (probably for a reason), I decided to go with *-of-type instead, which should you give the same result.
While using the *-child pseudo class will reflect your styles accordingly on the front-end, one needs to know that the back-end might show some inconsistencies.
You can read about this issue here.
Targeting elements more precisely with the *-of-type pseudo class instead will result in a more consistent experience.
I know it’s not an optimal solution, but we will probably (well, hopefully) see improvements in that regard down the road.