我想在页脚图片上添加版权文本,所以我制作了一个 ID 为“copyright”的段落。这是在我的 css 文件中:
.footer {
background: url(../images/footer_extend.png) repeat-x center;
overflow: hidden;
}
.footer img {
display:block;
margin:0px auto;
max-width:970px;
height: 130px;
overflow: hidden;
}
#copyright{
position:absolute;
color:#000;
bottom:1px;
left:46%;
}
所以文本应该居中,白色并且在页面的最底部。但对我来说,文本位于页面的中间(而不是底部)。为什么以及如何解决这个问题?
哦,这是我的 html 文件:
<div class="footer">
<img src="images/footer.png" width="970" height="130" alt="" />
<p id="copyright">© 2013</p>
</div>
最佳答案
您可能想将 position: relative
添加到 .footer
关于html - 页脚图像上的文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19304890/