प्रत्येक
तत्व को स्टाइल करने के लिए CSS :last-child चयनकर्ता का उपयोग करें जो उसके माता-पिता का अंतिम बच्चा है।
उदाहरण
आप :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>