Cześć. Mam taki problem. Chciałbym aby button-left znajdował się po lewej stronie. Utwór po srodku a button-right po prawej chciałbym aby było to zrobionę dzieki flexboxie uczę się go :) Ale te elementy dziwnie mi się układają pomozecie ? :)
Kod html:
<div class="title-group main">
<button mat-button color="primary" class="left-button" *ngIf="!showUsageTypeNavigation" (click)="returnClick()">Powrót do szczegółów</button>
<mat-label class="mat-label sub-title">
{{ subTitle | translate }}{{ usageType | usageTypeSubtitle }}
<ng-container *ngIf="!showUsageTypeNavigation">- <span class="spotify">Spotify</span></ng-container>
<mat-icon color="primary">
{{ icon }}
</mat-icon>
</mat-label>
<button mat-button color="primary" class="right-button" *ngIf="showUsageTypeNavigation" (click)="returnClick()">Dane live (spotify)</button>
<mat-label class="mat-label title">
<div [innerHtml]="getTitle()">
</div>
</mat-label>
</div>
Kod css:
.title-group {
display: flex;
flex: 1;
align-items: center;
flex-direction: column;
padding: 0 10px;
min-width: 250px;
&.main {
flex: 3;
@media (max-width: $large) {
padding-top: 15px;
}
}
.left-button {
display: flex;
justify-content: left;
}
.right-button {
display: flex;
justify-content: right;
}
.mat-label {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-size: 22px;
&.sub-title {
font-weight: 500;
color: grey;
.spotify {
color: $spotify-color;
}
.mat-icon {
padding-left: 5px;
}
}
https://zapodaj.net/91e4300eb0199.png.html