css - 如何修复顶部菜单组件?
问题描述
我需要在滚动页面时修复 topmenu 组件。滚动页面时工具栏组件消失。
怎么做?
html:
<app-toolbar></app-toolbar>
<mat-sidenav-container>
<mat-sidenav-content fxLayout="column">
<app-topmenu></app-topmenu>
<div fxFlex="1 1 auto">
<router-outlet></router-outlet>
</div>
<app-footer ></app-footer>
</mat-sidenav-content>
</mat-sidenav-container>
CSS:
mat-sidenav-container {
min-height : calc(100% - 60px);
height : calc(100% - 60px);
background-color: #eaeaea;
}
mat-sidenav-content {
min-height: 100%;
height : 100%;
}
解决方案
试试这个代码来定位固定的顶部菜单。
app-topmenu {
position: fixed;
top: 0;
left: 0;
width: 100%
}
推荐阅读
- javascript - 如何在角度材料表(mat-table)中实现编辑、更新和丢弃功能
- c# - 如何在c#中获取特定文件的文件路径
- python - 如何绘制颜色和文本的网格
- c# - 为什么我的 WPF 转换器“错过”文本框中的最后一个字符?
- c# - 每个范围的 Autofac 独特服务
- c# - 如何使用 Azure 函数后端保护静态客户端 Blazor 应用?
- android - Android:DataStore 相对于 SharedPreferences 的优势
- javascript - Expo/React Native 错误 - TypeError: undefined is not an object (evalating 'string.toLowerCase')
- c - C:通过命令行参数制作多项式函数
- python - 多处理从代码开头重新启动,而不是运行特定函数