तत्व का उपयोग करें ~ तत्व चयनकर्ता
- तत्वों का चयन करने के लिए
तत्व से पहले। आप इसे लागू करने के लिए निम्न कोड चलाने का प्रयास कर सकते हैं
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
p~ul {
color: white;
background-color: blue;
}
</style>
</head>
<body>
<h1>Demo Website</h1>
<h2>Fruits</h2>
<div>
<p>Vegetables are good for health.</p>
<ul>
<li>Spinach</li>
<li>Onion</li>
<li>Capsicum</li>
</ul>
</div>
<p>Fruits are good for health.</p>
<ul>
<li>Apple</li>
<li>Orange</li>
<li>Kiwi</li>
</ul>
</body>
</html>