Reputation: 11480
here is a demo i've created: https://stackblitz.com/edit/flex-layout-angular-material-fgconc
steps to reproduce:
When it starts wrapping the space left is gone and all space is on the right.
How can I have the same space "left and right" when the middle element wraps?
@Akber Iqbal 's suggestion style="text-align:center"
already does a good job.
Upvotes: 0
Views: 491
Reputation: 15031
Using your existing stackblitz, make one change in your app.component.html, just add: style="text-align:center" to the 2nd div
Final app.component.html to be:
<div fxLayout = "row nowrap" fxLayoutAlign = "space-evenly center">
<img fxFlex="0 0 auto" fxFlexAlign="center" style="height: 3em" src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png">
<div fxLayout = "row wrap" fxFlex = "0 1 auto" style="text-align:center">
<app-many-buttons [N]="10"></app-many-buttons>
</div>
<div fxLayout = "row nowrap" fxFlex = "0 0 auto">
<button mat-button class="materialIconButton">lol_1</button>
<button mat-button class="materialIconButton">lol_1</button>
<button mat-button class="materialIconButton">lol_1</button>
</div>
</div>
Upvotes: 1