【问题标题】:Images Over lapping my navigation bar图像重叠我的导航栏
【发布时间】:2016-01-23 17:13:09
【问题描述】:

导航栏代码

ul {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    list-style-type: none;
    background: black;
    margin: 0;
    padding: 0;
}

li {
    float: left;
    padding: 25px 25px;
    cursor: pointer;
}

a {
    text-decoration: none;
    color: white;
    font-size: large;
}

图片及代码

.image {
    position: relative;
    left: 500px;
    overflow: hidden;

所以当我平滑滚动时,文本会隐藏在导航栏后面。但enter image description hereimage 与导航栏重叠

现在在我的右边,“类似问题”的 div 也与底部的黑色 div 重叠

【问题讨论】:

  • 对不起,我忘了输入图片描述

标签: html css


【解决方案1】:

您应该将z-index 设置为ul,并确保它高于其他元素的值。

【讨论】:

    【解决方案2】:

    您需要将z-index 添加到高于内容滚动的主导航。如前所述。

    但你也在图像上使用position: relative,如果你也将其父位置设置为相对,那么图像将保留在主要内容包装器中,并在菜单下方滚动其余内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-23
      • 1970-01-01
      • 2019-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多