CSS :only-of-type নির্বাচক ব্যবহার করুন প্রতিটি
এলিমেন্টকে স্টাইল করার জন্য যেটি তার পিতামাতার একমাত্র
উপাদান।
উদাহরণ
আপনি :only-of-type নির্বাচক:
বাস্তবায়ন করতে নিম্নলিখিত কোডটি চালানোর চেষ্টা করতে পারেন<!DOCTYPE html>
<html>
<head>
<style>
p:only-of-type {
background: orange;
color: white;
}
</style>
</head>
<body>
<div>
<p>This is demo text 1.</p>
</div>
<div>
<p>This is demo text 2.</p>
<p>This is demo text 3.</p>
<p>This is demo text 4.</p>
</div>
</body>
</html>