ফ্লেক্স আইটেমগুলোর দিকনির্দেশনা নির্ধারণ করতে flex-direction প্রোপার্টি ব্যবহার করা হয়। column মান দিলে আইটেমগুলো লম্বাবত (ভার্টিক্যাল) সাজাবে।
উদাহরণ
নিচের কোডটি চালিয়ে লম্বাবত ফ্লেক্স দিকনির্দেশনা দেখুন:
<!DOCTYPE html> <html>
<head>
<style>
.mycontainer {
display: flex;
flex-direction: column;
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: column সেট করলে মেইন অক্ষ লম্বাবত হয়ে যায়, ফলে আইটেমগুলো উপরে থেকে নিচে সাজে। ডিফল্ট মান row হরিজেন্টাল সাজায়।