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