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

CSS :first-line সিউডো-এলিমেন্টের ব্যবহার

এই এলিমেন্টটি ব্যবহার করুন একটি সিলেক্টরে টেক্সটের প্রথম লাইনে বিশেষ স্টাইল যোগ করতে। নিচের উদাহরণটি দেখায় কীভাবে :first-line এলিমেন্ট ব্যবহার করে ডকুমেন্টের এলিমেন্টগুলোর প্রথম লাইনে বিশেষ ইফেক্ট দেওয়া যায়।

উদাহরণ

<html>
  <head>
    <style>
      p:first-line {
        text-decoration: underline;
      }
      p.noline:first-line {
        text-decoration: none;
      }
    </style>
  </head>
  <body>
    <p class="noline"> This line would not have any underline because this belongs to nline class.</p>
    <p>The first line of this paragraph will be underlined as defined in the CSS rule above. Rest of the lines in this paragraph will remain normal. This example shows how to use :first-line pseduo element to give effect to the first line of any HTML element.</p>
  </body>
</html>
  1. CSS দিয়ে এলিমেন্ট ভার্টিক্যালি সেন্টার করুন

  2. CSS-এ ::first-line 의사-এলিমেন্ট

  3. CSS-এ এলিমেন্ট টাইপ সিলেক্টর

  4. CSS-এ Pseudo-element কী?