角材料中心佈局 (Angular Material center layout)


問題描述

角材料中心佈局 (Angular Material center layout)

我用 Angular Material 弄濕了我的腳。

我已經參考了角度材料網站上的文檔,我正在嘗試完成以下操作:AngularJS Material Toolbar

第二個

標籤,即“主人的名字”應該出現在中間。而 ngmasters 的位置很好。

這就是我試圖實現此功能無濟於事的方式:

<md‑toolbar>
    <div class="md‑toolbar‑tools">
        <p><strong>ngMasters</strong></p>
        <div layout="row" layout‑align="center center">
            <p>Name of the Master</p>
        </div>
    </div>

</md‑toolbar>

任何幫助或方向都將不勝感激。謝謝。


參考解法

方法 1:

You'll need to apply the flex attribute to the <div> so it takes up available space within the <md‑toolbar>:

<md‑toolbar>
    <div class="md‑toolbar‑tools">
        <p><strong>ngMasters</strong></p>
        <div flex="" layout="row" layout‑align="center center">
            <p>Name of the Master</p>
        </div>
    </div>

</md‑toolbar>

(by Nosailgnerkus)

參考文件

  1. Angular Material center layout (CC BY‑SA 2.5/3.0/4.0)

#angular-material #css #angularjs






相關問題

除了現有的 md 芯片外,如何添加自定義 md 芯片? (how to add custom md-chips in addition to existing md-chips?)

角材料中心佈局 (Angular Material center layout)

如何使 md-action 按鈕粘在 md-card 的底部? (How to make md-action buttons to stick to the bottom of md-card?)

Angular 材質日期選擇器在不注入依賴項的情況下工作 (Angular material datepicker working without injecting dependencies)

如何禁用墊下拉選項從一到二? (How to disable mat drop down option from one to two?)

角度材質工具欄不繼承自角度材質 (Angular material toolbar not inheriting from angular materials)

如何更改 Angular Material 中的標籤標籤? (How to change tab label in Angular Material?)

如何使用按鍵角 9 選擇下拉值 (how to select the dropdown value using key press angular 9)

在 mat-grid-tile Angular 上顯示 flex (display flex on mat-grid-tile Angular)

不能使用 Angular Material 日期範圍日期過濾器 (Can't use Angular Material date range date filter)

如何更改 matInput 佔位符的顏色? (How can I change the color of placeholder of matInput?)

使用 mat-expansion-panel 時增加下拉菜單的高度 (Increase the height of Dropdown menu when using mat-expansion-panel)







留言討論