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

CSS flex-direction: row মান ব্যবহার

flex-direction: row মান ফ্লেক্স আইটেমগুলকে হরিজেন্টাল (বাম থেকে ডানে) সাজায়। এটি ডিফল্ট মান।

উদাহরণ

নিচের কোডটি চালিয়ে row মান ব্যবহার দেখুন:

<!DOCTYPE html> <html> 
  <head> 
    <style> 
      .mycontainer { 
        display: flex; 
        flex-direction: row; 
        background-color: orange; 
      } 
      .mycontainer > div { 
        background-color: white; 
        text-align: center; 
        line-height: 40px; 
        font-size: 25px; 
        width: 100px; 
        margin: 5px; 
      } 
    </style> 
  </head> 
  <body> 
    <h1>Quiz</h1> 
    <div class="mycontainer"> 
      <div>Q1</div> 
      <div>Q2</div> 
      <div>Q3</div> 
      <div>Q4</div> 
      <div>Q5</div> 
      <div>Q6</div> 
    </div> 
  </body> 
</html>

ব্যাখ্যা: flex-direction: row মেইন অক্ষকে হরিজেন্টাল করে দেয়, ফলে আইটেমগুলো বাম থেকে ডানে সারিয়ে থাকে। RTL (রাইট-টু-লেফ্ট) ভাষার জন্য অর্ডার উল্টা হয়।

  1. CSS justify-content: space-between মান ব্যবহার

  2. CSS flex-flow প্রোপার্টি

  3. CSS flex-basis প্রোপার্টি

  4. CSS flex-direction: row-reverse মান ব্যবহার