CSS में फ्लेक्स आइटम्स के डायमेंशन्स कंट्रोल करने के लिए, flex प्रॉपर्टी का उपयोग करें। फ्लेक्स आइटम्स के डायमेंशन्स कंट्रोल करने का कोड निम्न है -
उदाहरण
<!DOCTYPE html> <html> <head> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .container { display: flex; width: 100%; } div { width: 200px; height: 200px; color: white; text-align: center; font-size: 30px; } .first { background-color: rgb(55, 0, 255); flex: 2 1 auto; } .second { background-color: red; } .third { background-color: rgb(140, 0, 255); } </style> </head> <body> <h1>Controlling flex items dimesions</h1> <div class="container"> <div class="first">First Div</div> <div class="second">Second Div</div> <div class="third">Third Div</div> </div> </body> </html>आउटपुट
उपरोक्त कोड निम्न आउटपुट उत्पन्न करेगा -
