Looking at the CSS3 specs, I cannot find a way to select any element that has no children.
Let me explain.
<body> <h1>Main Page</h1> <div id="main"> <div class="post"> <h2>Article 1</h1> <p>some text</p> </div> <div class="post"> <h2>Article 2</h1> <p>some text</p> </div> </div> </body>
I am looking for CSS syntax to select h1, two h2 and two p. The method of choice on any page, all elements without children. Any suggestion?
Sorry, I forgot to add the "empty" part, I actually already use the *: empty selector, but it does not work for any tag that has nodeText as a child. Therefore, it works for any input, image, object, but not for h2, h1 or any p.
rnaud source share