CSS3渐变背景与底部不必要的白色空间 [英] CSS3 gradient background with unwanted white space at bottom
问题描述
当我应用CSS3渐变并且内容的滚动条高度不足时,我有很多困难去除底部的空白。
I am having a great deal of difficulty with getting rid of the white space at the bottom when I apply a CSS3 gradient and the content has insufficient height for a scrollbar.
如此处: http://womancareolympia.webs.com /
我已经尝试过将html和body height设置为100%或auto。我可以使渐变到底部这样,但是当内容需要一个滚动条,内容流过渐变。
I have tried playing with setting both html and body heights to 100% or auto. I am able to make the gradient go to the bottom this way, but then when content requires a scrollbar, the content flows past the gradient.
感谢您的帮助! / p>
Thanks for the help!
推荐答案
- 添加
min-height:100%
padding-top 从删除所有实例 code> body
(或以其他方式将其设置为0
)。 - 设置
top:129px
#fw-container
。 - margin-bottom:110px 上
#fw-container
。 - :hidden 到
#fw-foottext
。 - Add
min-height: 100%
tobody
. - Remove all instances of
padding-top
frombody
(or otherwise set it to0
). - Set
top: 129px
on#fw-container
. - Set
margin-bottom: 110px
on#fw-container
. - Add
overflow: hidden
to#fw-foottext
.
(仅在Chrome + Firefox中测试)
(tested in Chrome+Firefox only)
我认为您应该重新设计CSS 像 top:100px
和 margin-top:-50px
没有理由。
I do think you should redesign your CSS to not use stuff like top: 100px
and margin-top: -50px
all over the place. There's just no reason for it.
这篇关于CSS3渐变背景与底部不必要的白色空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!