页脚。它与div重叠 [英] Footer. It overlaps on div

查看:106
本文介绍了页脚。它与div重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站页脚有问题。它与内容div重叠。我有一个这样的结构:

I've got a problem with the footer of my website. It overlaps to the content div. I've got a structure like this:

#content {
  width: 80%;
  color: white;
  margin: 0 auto;
  font-family: "Arial";
  clear: both;
}
#footer {
  font-family: "Arial";
  left: 0;
  right: 0;
  bottom: 0;
  color: #E6E6E6;
  padding: 2%;
  font-size: 70%;
  text-align: center;
  position: absolute;
}

<div id="content">
  <div id="logo">
    <img logo here>
  </div>

  <div id="paragraph">
    <p>here
  </div>

  <div id="footer">
    Footer content
  </div>
</div>

问题是,在一个页面中我有一个图像和一个段落,它看起来很好,因为它没有触及页脚位置。但是,当我有需要滚动的文本时,页脚会与其重叠。

The problem is that in one page I've got an image and a paragraph and it looks fine because it's not touching the footer position. But when I have text that need to be scrolled, the footer overlaps into it

推荐答案

这意味着绝对位置的任何元素都将放置在那里,所以你最好使用position:relative;

its because you are using position:absolute; wich mean that any element with position absolute will be placed there no matter what, so you better use position:relative;

这篇关于页脚。它与div重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆