首页 > 解决方案 > 路由器插座的粘性底部元件

问题描述

结构:

<app-header></app-header>
<router-outlet></router-outlet>
<app-footer></app-footer>

一个组件有一个我想粘在底部的按钮。像:

position: -webkit-sticky;
position: sticky;
bottom: 1rem;
align-self: flex-end;

但是您看到有一个app-footer- 在页脚部分向下滚动时,我的按钮不会粘在底部。如何使其底部也位于页脚上方?

标签: cssangular

解决方案


为您的按钮使用固定位置

.button-class {
 position: fixed;
 bottom: 1rem;
}

推荐阅读