我正在尝试重叠图像顶部的导航栏

时间:2014-06-13 04:16:01

标签: html5 css3

我一直在玩我的边缘,但它并没有让步。我将导航栏的z-index设置得更大,但它不会在图像上重叠。

1 个答案:

答案 0 :(得分:0)

这可以帮助您,适应您的需求: HTML

<html>
    <body>
        <div class="nav">
        </div>
        <img class="img-under">
    </body>
</html>

的CSS

.nav {
  position:absolute;
  background-color:#000000;
  width:100%;
  height:30px;
}
.img-under {
  background-color:#e3e3e3;
  height:60px;
  width:200px;
}