4 ms·
There is an :empty state you can use. I'm not looking at the demo right now but I've added messages like this: .container:empty:before { content: 'Th
by err4nt 10y ago
There is an :empty state you can use. I'm not looking at the demo right now but I've added messages like this:
.container:empty:before {
content: 'There are no Messages'
}
- dahauns 10y agoJust be aware that the element really has to be empty - any whitespace (including empty child tags etc.) makes the selector ignore it.
- err4nt 10y agoYeah, whitespace makes a textNode so an element containing any nodes can't be :empty. Also gotta watch out for those whitespace-only extra nodes when counting the children of an element with JavaScript, it often returns more children than you think at first ;)