প্যারেন্টের একমাত্র চাইল্ড হয়ে <p> এলিমেন্ট স্টাইল করতে CSS :only-child সিলেক্টর ব্যবহার করুন।
উদাহরণ
নিচের কোড রান করে :only-child সিলেক্টর ইমপ্লিমেন্ট করুন।
<!DOCTYPE html> <html> <head> <style> p:only-child { background: orange; } </style> </head> <body> <h1>Heading</h1> <div> <p>This is a paragraph.</p> </div> <div> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> </div> </body> </html>