2 ms·
https://css-tricks.com/almanac/selectors/o/only-child/ https://css-tricks.com/almanac/selectors/o/only-child/ The :only-child pseudo-class selector property in
by bryanrasmussen 6y ago
https://css-tricks.com/almanac/selectors/o/only-child/ https://css-tricks.com/almanac/selectors/o/only-child/
The :only-child pseudo-class selector property in CSS represents an element that has a parent element and whose parent element has no other element children.
on edit: sorry I got confused and dropped your requirement to select the parent.
- codetrotter 6y agoYes but you cannot select the parent p which is what they were talking about.
- bryanrasmussen 6y agoah you're right, I misread.