sudhakarinfotech
(current)
Run Code
Live Code Editor- CSS3 Flex Grow
Source Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>CSS Flex </title> <style> .flex-container { display: flex; flex-direction:row; background-color:lightgray; height:120px; } .flex-item{ background-color:orange; color:white; text-align:center; height:80px; width:80px; line-height:80px; margin:10px; padding:10px; } .bg-info{ background-color:#17A2B8; } .bg-primary{ background-color:#007BFF; } .bg-warning{ background-color:#FFC107; } </style> </head> <body> <h1>The flex-grow Property</h1> <div class="flex-container"> <div class="flex-item bg-info" style="flex-grow: 1">1</div> <div class="flex-item bg-primary" style="flex-grow: 2">2</div> <div class="flex-item bg-warning" style="flex-grow: 4">3</div> </div> </body> </html>
Source Code Output :
Running