gpt4 book ai didi

css - Div 不会将自己定位在父 div 的底部

转载 作者:太空宇宙 更新时间:2023-11-03 23:56:35 24 4
gpt4 key购买 nike

这应该相当简单,但出于某种原因我无法将“页脚”div 放置在“容器”div 的底部。这与母版页格式有关,因此如果我将其调整为在一个页面上看起来不错,它不会在另一页上显示。有人可以快速看一下并帮助我吗?

#container {
background-color: #fafafa;
height: auto;
width: 1112px;
margin: 0 auto 0 auto;
position: relative;
}

#footer {
background-color: #fafafa;
width: 1112px;
height: 25px;
margin-left: auto;
margin-right: auto;
position: absolute;
bottom: 0;
}

#ftr-nav {
position: absolute;
bottom: 0;
right: 0;
float: right;
padding: 15px 30px 0 0;
}

.ftr-link-home {
font: 9px #0094ff;
}

.ftr-link-admin {
font: 9px #0094ff;
}

#copy {
float: right;
padding: 0 15px 0 0;
font-size: small;
position: absolute;
right: 115px;
bottom: 0;
}

http://jsfiddle.net/Develop_er/c32Mm/2/

最佳答案

添加这个:

html,body
{
height: 100%;
}
#container {
background-color: #fafafa;
height: 100%; /* <--- */
width: 1112px;
margin: 0 auto 0 auto;
position: relative;
}

FIDDLE

关于css - Div 不会将自己定位在父 div 的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18451729/

24 4 0
文章推荐: node.js - tensorflow 导入时出现意外标记 *
文章推荐: python - 如何对整数列表的一部分进行排序?
文章推荐: python - 如何合并单个订单的值?
文章推荐: html - 如何安排