在我的项目中使用 flexlayout,页脚无法正确渲染
场景: 如果没有文字,那么页脚应该贴在屏幕底部,如果超过屏幕内容,那么页脚应该被推到屏幕底部。
下面是我的代码:
<mat-sidenav-container fxLayout="column" fxFlexFill>
<mat-sidenav></mat-sidenav>
<mat-sidenav-content>
<header>
<mat-toolbar></mat-toolbar>
</header>
<section fxFlexFill>
<!--Content Area -->
</section>
<footer>
<mat-toolbar></mat-toolbar>
</footer>
</mat-sidenav-content>
</mat-sidenav-container>
上面的代码在页脚中占用了额外的空间,即使内容较少,也意味着出现滚动条。可以建议我在这里错过的内容。
使用 CSS
body,html{
height:100%;
}