प्रत्येक
तत्व को स्टाइल करने के लिए CSS:last-child चयनकर्ता का उपयोग करें जो उसके माता-पिता का अंतिम बच्चा है। आप निम्न कोड को लागू करने का प्रयास कर सकते हैं:अंतिम-चाइल्ड चयनकर्ता
<!DOCTYPE html>
<html>
<head>
<style>
p:last-of-type {
background: orange;
}
</style>
</head>
<body>
<h2>Heading</h2>
<p>This is demo text1.</p>
<p>This is demo text2.</p>
<p>This is demo text3.</p>
</body>
</html>