CSS Pseudo-class :only-child

Selects an element, if it's the only child of its parent-element. This pseudo-class is helpful if you want to remove the border from linked images (because usually there's only one image inside an <a>). Note that :only-child also selects an element if it has its own children. It just has to be the only child of its parent-element.

Examples





Comment