কম্পিউটার টিউটোরিয়াল

CSS :only-of-type সিলেক্টরের ভূমিকা


প্যারেন্টের একমাত্র <p> এলিমেন্ট স্টাইল করতে 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>

  1. CSS :hover সিলেক্টরের ভূমিকা

  2. CSS :focus সিলেক্টরের ভূমিকা

  3. CSS :nth-last-of-type(n) সিলেক্টরের ভূমিকা

  4. CSS :nth-last-child(n) সিলেক্টরের ভূমিকা