2017-11-25 158 views
0

角材2 sidenav內容一直在嘗試幾個地方在CSS中的角材2如何強制從底部

mat-sidenav-container { 
    background: white; 
    bottom: 0px !important; /* <---- no help */ 
} 
mat-sidenav { 
    width: 300px; 
    height: 500px; 


    padding-left:20px; /* Not sure why content goes out of range*/ 
    bottom: 0px !important; /* <---- no help */ 
} 

Trying to make sidenav content start from bottom in this example 覆蓋現有sidenav組件,但我似乎無法在此組件覆蓋任何東西由角材料提供2

回答

1

爲了實現這一點,不需要重寫.mat類樣式。使用以下CSS將內容放置在底部。

側面導航內容:

<div class="inner-content" id="botNav" mat-list-item> 
    <button mat-button *ngFor="let app of apps">{{ app }}</button> 
</div> 

CSS來放置內容:

.inner-content{ 
    position: absolute; 
    bottom: 0; 
    left: 0; 
} 

演示:https://plnkr.co/edit/GZroFhKjuXhtYu7bvgPK?p=preview