⊗mkSpFxUWG 88 of 128 menu

Greediness with unspecified width of flex blocks in CSS

If flex elements do not have a specified width, then this width will be generated based on the content:

<div class="parent"> <div class="child elem1">text text text</div> <div class="child elem2">text</div> </div> .parent { display: flex; width: 300px; height: 200px; border: 1px solid red; } .child { height: 50px; border: 1px solid green; }

:

If you set greediness for such elements, the free space will be added to the width formed by the text:

<div class="parent"> <div class="child elem1">text text text</div> <div class="child elem2">text</div> </div> .parent { display: flex; width: 300px; height: 200px; border: 1px solid red; } .child { height: 50px; border: 1px solid green; } .elem1 { flex-grow: 1; } .elem2 { flex-grow: 1; }

:

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline