作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近注意到,在某些版本的 Google Chrome 中,当内容由脚本生成时,Compass 使用的经典的纯 css 粘性页脚解决方案不起作用。页脚只是覆盖内容而不是向下移动。当您调整窗口大小时,布局将更改为正确的布局。 compass中的css/html基于http://ryanfait.com/resources/footer-stick-to-bottom-of-page/上提供的解决方案
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -4em;
}
.footer, .push {
height: 4em;
}
使用以下 html:
任何想法,如何解决这个问题?
<html>
<head>
<link rel="stylesheet" href="layout.css" ... />
</head>
<body>
<div class="wrapper">
<p>Your website content here.</p>
<div class="push"></div>
</div>
<div class="footer">
<p>Copyright (c) 2008</p>
</div>
</body>
</html>
最佳答案
我认为你应该添加 clear:both
.footer, .push
{
clear:both;
height: 4em;
}
或者试试这个链接
关于javascript - 粘性页脚 chrome 不适用于动态内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11535006/
我是一名优秀的程序员,十分优秀!