This question is similar to this Can CSS detect the number of children an element has?
But istead of styling children I need to style container: HTML:
<ul>
</ul>
CSS:
.selector:before {
content: "Empty list";
color: red;
}
For the case of empty elements I can use :empty pseudo-class, but what if i want special styles for elements with N children ?