当页面内容未到达屏幕末尾时,我试图让我的页脚粘在底部。
我正在构建 Angular 5 应用程序。
我添加了 <header>
, <main>
和 <footer>
标记到我的 app.component.html
.
我尝试在各处添加来自 Materialise 的所需 CSS。在全局 css 文件中,app.component css 文件中,甚至在 Materialize css 中。我只是不知道我做错了什么。
这是我的 app.component.html
:
<header>
<app-navbar></app-navbar>
</header>
<main>
<div class="container">
<router-outlet></router-outlet>
</div>
</main>
<app-footer></app-footer>
app-footer
以此开头:
<footer class="page-footer blue darken-2">
我想知道将我的页脚转到页面底部所需的 css 放在哪里。
最佳答案
一个快速的答案是将 FooterComponent 中的 html 放在 index.html 中。 用标签包围你的标签,就像这个例子:
<body>
<main>
<app-root></app-root>
</main>
<footer>
<!-- your footer html here -->
</footer>
</body>
(记得删除 FooterComponent 中的 html)
关于css - Materialise CSS 和 Angular 5 - 粘性页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49327669/