内容高度不同的底边距
我有一个问题一直试图解决,但没有任何进展。
这是我的代码的摘要:
body {
background-image: url('img/bg_Body.gif');
margin: 0px 0px 0px 0px;
}
#container {
position: relative;
width: 880px;
margin-left: auto;
margin-right: auto;
top: 0px;
min-height: 100%;
}
#content {
position: absolute;
top: 0px;
left: 0px;
background-image: url('img/faux_tile.png');
min-height: 200px;
padding-top: 105px;
padding-right: 80px;
min-width: 400px;
padding-left: 80px;
padding-bottom: 110px;
}
<div id="container">
<div id="content">
Some content here (Varying height)
</div>
</div>
如何在内容和页尾之间添加边距?
faux_tile.png
覆盖到页面末尾,我想要页面末尾和 faux_tile.png 之间有一个边距,这是一个显示 bg_Body.gif
的小边距>。
I have a problem I have been trying to solve, but without any progress.
This is a summary of my code:
body {
background-image: url('img/bg_Body.gif');
margin: 0px 0px 0px 0px;
}
#container {
position: relative;
width: 880px;
margin-left: auto;
margin-right: auto;
top: 0px;
min-height: 100%;
}
#content {
position: absolute;
top: 0px;
left: 0px;
background-image: url('img/faux_tile.png');
min-height: 200px;
padding-top: 105px;
padding-right: 80px;
min-width: 400px;
padding-left: 80px;
padding-bottom: 110px;
}
<div id="container">
<div id="content">
Some content here (Varying height)
</div>
</div>
How do I add a margin between the content and the end of the page?
The faux_tile.png
covers to the end of the page, I want a margin between the end of the page and the faux_tile.png, which is a small margin showing bg_Body.gif
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
另一种方法可能是给
#container
一个小于 100% 的min-height
try this:
the other way could be to give
#container
amin-height
of less than 100%您可以给
body
一个margin-bottom
。即使您的容器是
position:absolute
,应该强制留出边距。You could give
body
amargin-bottom
.That should force a margin even though your container is
position: absolute
.