【发布时间】:2017-01-26 15:08:18
【问题描述】:
无论页脚有多少内容,粘性页脚都会粘在网页底部。如果您在网页的 CSS 样式表中使用 FlexBox 命令,这是一个已解决的问题。所有现代浏览器都支持 FlexBox。
但是,使用 Angular2 构建 Web 应用程序,我无法应用最简单的 FlexBox 命令!页脚不粘在底部!这是我的plunker to demonstrate the issue。
在 plunker 应用程序中,style.css 包含一个非常简单的 Flexbox 命令并且它可以工作 - 只需将 index.html 的内容替换为 index1.html 并查看粘性页脚如何工作在没有 Angular 的情况下。对于 Angular2 应用程序,我使用相同的 style.css,因此我将以下模板添加到应用程序中,明确标记 CSS 类 main 和 footer,如下所示。
<div class="main">
<h2>Hello {{name}}</h2>
</div>
<footer class="footer">
<h3> this is footer </h3>
</footer>
但是,页脚永远不会粘住。
有没有人能够在 Angular2 中解决这个问题? Angular2 是否有另一种方式来提供粘性页脚?
任何想法和想法将不胜感激。
【问题讨论】:
标签: css angular sticky-footer