सीएसएस का उपयोग करें:प्रत्येक
तत्व को स्टाइल करने के लिए खाली चयनकर्ता जिसमें सीएसएस के साथ कोई बच्चा नहीं है। आप :खाली चयनकर्ता को लागू करने के लिए निम्न कोड चलाने का प्रयास कर सकते हैं -
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
p.demo {
width: 300px;
height: 20px;
background: gray;
}
p:empty {
width: 150px;
height: 20px;
background: orange;
}
</style>
</head>
<body>
<p class = "demo">This is demo text. Below is empty text.</p>
<p></p>
</body>
</html>