HTML CSS examples for CSS Selector:empty
The :empty selector selects element that has no children including text nodes.
Select empty <p> elements:
<!DOCTYPE html> <html> <head> <style> p:empty {<!-- w w w . ja v a2 s.c o m--> width: 100px; height: 20px; background: #ff0000; } </style> </head> <body> <p></p> <p>A paragraph.</p> <p>Another paragraph.</p> <p> </p> </body> </html>