|
||||
Flexbox: flex-grow und flex-shrink
Moin.
Mir ist die Interpretation der Specs zu flex-grow und flex-shrink noch nicht klar. "This <number> component sets flex-grow longhand and specifies the flex grow factor, which determines how much the flex item will grow relative to the rest of the flex items in the flex container when positive free space is distributed." https://www.w3.org/TR/css-flexbox-1/#flex-grow-property Beispiel: HTML-Code:
.flex-container { display: flex; } .flex-container .flex-item { flex: 1 }.flex-container .flex-item { flex-grow: 2; }.flex-container .flex-item { flex-grow: 3; }<div class="flex-container"> <div class="flex-item">...</div> <div class="flex-item">...</div></div> Als Bruch: 2/5 und 3/5 Wenn jedoch in ein hochaufgelöstes Bild in Flex-Item 1 steht, dehnt es sich solange aus, wie Platz im Flex-Container ist. Der Reste bleibt dann für Flex-Item 2 übrig. Die Methode ist also nicht geeignet, maximale relative Breiten für Flex-Items festzulegen. Ist das erstmal so korrekt?
__________________
|
Sponsored Links |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Flexbox | Soelg | CSS | 1 | 21.05.2018 01:32 |