html - 手动设置高度时div重叠

标签 html css

这是页面:https://hamzicabdulah.github.io/Raptitude/

当手动设置“other-stories”div 的高度时,“other-stories”和“footer”类的 div 重叠:

.other-stories {
  height: 65%;
}
@media screen and (min-width: 768px) {
  .other-stories {
    height: 89%;
  }
}

如果我删除上面的代码,div 就不会重叠。考虑到“其他故事”div 的手动设置高度需要留在那里才能在 Firefox 中正常工作,这里的解决方法是什么?

最佳答案

将 float 设置为页脚和其他文章。

.other-stories {
  height: 65%;
  float:left;
}
@media screen and (min-width: 768px) {
  .other-stories {
    height: 89%;
    float:left;
  }
}

关于html - 手动设置高度时div重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41307079/

相关文章:

html - 从响应式网格布局中添加行和删除间隙

javascript - 使用JQuery获取div中未选中复选框的值

html - 图片不在正确的位置

html - 带背景图像的透明文本

html - CSS:定位每个类的第一个对象

javascript - 如何将文本发送到某个地址(使用 Javascript)?

css - 使用 'specifically' 字体样式而不是 html 或 css 字体样式(谷歌字体)

CSS 动画对象并保持其新位置

html - { margin : 0px auto;} not centering div

javascript - 如何在拖动时将第一个太阳变形为黑暗的太阳?