প্যারেন্টের দ্বিতীয় চাইল্ড হয়ে <p> এলিমেন্ট স্টাইল করতে CSS :nth-child(n) সিলেক্টর ব্যবহার করুন।
উদাহরণ
নিচের কোড রান করে :nth-child(n) সিলেক্টর ইমপ্লিমেন্ট করুন।
<!DOCTYPE html> <html> <head> <style> p:nth-child(4) { background: orange; color: white; } </style> </head> <body> <p>This is demo text 1.</p> <p>This is demo text 2.</p> <p>This is demo text 3.</p> <p>This is demo text 4.</p> <p>This is demo text 5.</p> <p>This is demo text 6.</p> </body> </html>