![](/img/trans.png)
[英]How to pin mat-toolbar and mat-sidenav and only have a scrollbar inside mat-sidenav-content?
[英]Mat-toolbar content alignmnet
我想在此示例中將內容左右對齊。
https://material.angular.io/components/toolbar/examples
我想要圖標在左側,文本在中間,用戶名在最右邊。
我怎樣才能做到這一點?
您可以執行以下操作來完成此操作。
將mat-icon
移到容器的頂部,使其首先放置。
<mat-toolbar-row>
<mat-icon class="example-icon">verified_user</mat-icon>
將example-spacer
類應用於中間所需的文本。
<span class="example-spacer">Second Line</span>
將以下內容添加到toolbar-multirow-example.css
的example-spacer
類中
text-align: center;
之后的用戶名
<span>User Name</span>
Stackblitz
https://stackblitz.com/edit/angular-tesmev?embed=1&file=app/toolbar-multirow-example.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.