CSS :first-child নির্বাচক প্রতিটি
উপাদানকে স্টাইল করতে ব্যবহার করুন যা তার পিতামাতার প্রথম সন্তান।
উদাহরণ
আপনি :প্রথম শিশু নির্বাচক
বাস্তবায়ন করতে নিম্নলিখিত কোড চালানোর চেষ্টা করতে পারেন<!DOCTYPE html>
<html>
<head>
<style>
p:first-child {
background-color: orange;
}
</style>
</head>
<body>
<h1>Heading</h1>
<p>This is demo text.</p>
<div>
<p>This is demo text, with the first child of its parent div.</p>
<p>This is demo text, but not the first child.</p>
</div>
</body>
</html>