gpt4 book ai didi

html - 页脚。它重叠在 div 上

转载 作者:行者123 更新时间:2023-11-28 06:43:35 24 4
gpt4 key购买 nike

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

#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>

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

最佳答案

因为你使用的是 position:absolute;这意味着任何具有绝对位置的元素无论如何都会被放置在那里,所以你最好使用 position:relative;

关于html - 页脚。它重叠在 div 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34161986/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com