PNLdev
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
En
English
فارسی
En
English
فارسی
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
Run
<!DOCTYPE html> <html> <head> <style> #main { width: 250px; height: 100px; border: 1px solid #88c999; display: flex; } #main div { flex-grow: 0; flex-shrink: 0; flex-basis: 50px; } #main div:nth-of-type(2) { flex-basis: 100px; } </style> </head> <body> <h1>flex-basis property example</h1> <p>Set the initial length of the flex items to 50 pixels, with an exception; set the initial length of the second flex item to 100 pixels:</p> <div id="main"> <div style="background-color:yellow;">50px</div> <div style="background-color:lightgreen;">100px</div> <div style="background-color:brown;">50px</div> <div style="background-color:purple;">50px</div> <div style="background-color:red;">50px</div> </div> <p><b>Note:</b> Internet Explorer 10 and earlier versions do not support the flex-basis property.</p> </body> </html>