ফ্লেক্স আইটেমের (চাইল্ড এলিমেন্টের) প্রোপার্টিগুলো:
order- প্রদর্শন ক্রমflex-grow- বড় হওয়ার ক্ষমতাflex-shrink- ছোট হওয়ার ক্ষমতাflex-basis- প্রাথমিক আকারflex- শর্টহ্যান্ড (grow, shrink, basis)align-self- নিজস্ব ক্রস-অক্ষ এলাইনমেন্ট
উদাহরণ: flex-basis
flex-basis প্রোপার্টি দিয়ে ফ্লেক্স আইটেমের দৈর্ঘ্য সেট করা হয়। নিচের কোডটি চালিয়ে উদাহরণ দেখুন:
<!DOCTYPE html> <html>
<head>
<style>
.mycontainer {
display: flex;
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 style="flex-basis: 350px">Q4</div>
<div>Q5</div>
<div>Q6</div>
<div>Q7</div>
<div>Q8</div>
<div>Q9</div>
</div>
</body>
</html>
ব্যাখ্যা: Q4-তে flex-basis: 350px সেট করা হয়েছে। বাকি আইটেমগুলোর ডিফল্ট বেসিস auto (১০০পিক্সেল)। Q4 প্রাথমিকভাবে ৩৫০পিক্সেল জায়গা নেবে।