জাভাস্ক্রিপ্টে ফ্লেক্সIBLE আইটেমের দিক সেট করতে flexDirection প্রপার্টিটি ব্যবহার করুন।
উদাহরণ
নিচের কোডটি চালিয়ে flexDirection প্রপার্টি ব্যবহার করে ফ্লেক্সIBLE আইটেমের দিক সেট করার পদ্ধতি শিখুন:
<!DOCTYPE html> <html> <head> <style> #box { border: 1px solid #000000; width: 450px; height: 150px; display: flex; flex-direction: column; } #box div { flex-grow: 0; flex-shrink: 1; flex-basis: 20px; } </style> </head> <body> <div id = "box"> <div style = "background-color:orange;">DIV1</div> <div style = "background-color:blue;">DIV2</div> <div style = "background-color:yellow;" id="myID">DIV3</div> </div> <p>flexDirection প্রপার্টি ব্যবহার করে</p> <button onclick = "display()">সেট করুন</button> <script> function display() { document.getElementById("box").style.flexDirection = "row-reverse"; } </script> </body> </html>
সম্ভাব্য মান: row (ডিফল্ট, বাম থেকে ডান), row-reverse (ডান থেকে বাম), column (উপর থেকে নিচ), column-reverse (নিচ থেকে উপর)। উদাহরণে প্রাথমিকভাবে column ছিল, বোতাম ক্লিক করলে row-reverse হয়ে যায়।