制作 100% 高度的网站,最小高度:100%;,滚动时仍然不显示
我正在改编这个 - quintadobode.thetwilightwalkers.com - html 模板,当我滚动(在包含内容的页面之一,如 oprojecto 等)时,没有背景。我正在使用 .expandheight 类,其 min-height: 100%;,这种情况仍然会发生。这让我发疯,请帮忙。
I'm adapting this - quintadobode.thetwilightwalkers.com - html template, and when I scroll (on one of the pages with content, like o projecto, etc.) there's no background. I'm using an .expandheight class, with min-height: 100%;, and that still happens. It's driving me nuts, please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您在
main
元素上设置了height: 100%
。如果你删除它,对我来说效果很好。You have
height: 100%
set on yourmain
element. It works fine for me if you remove this.我还没有真正测试过你的 CSS,但是如果你从 #main 块样式中删除
height:100%
,对于像“O Projecto”这样的页面,背景会一直向下,是吗?解决你的问题吗?I haven't really tested your CSS, but if you remove the
height:100%
from your #main block styles, the background will go all the way down for pages like "O Projecto", does that solve your problem?您还需要在
html
和body
上设置min-height:100%
。You need to set
min-height:100%
onhtml
andbody
as well.