我的侧边栏与标题图像重叠。由于Z索引不适用于图像,因此我不知道该怎么办。我可以使边栏以某种方式消失在页面顶部吗?还是可以在图像周围包裹一些东西,以便z-index起作用?
.sidebar {
height: 100%;
width: 250px;
position: fixed;
z-index: 3;
top: 0;
left: 0;
background-color: blue;
overflow: auto;
padding-top: 350px;
}
header {
z-index: 10
}
<div>
<img src="{% static " images/life_italic.jpg "%}" id="headerimg" class="rounded" height="30%" width="100%" alt="fail">
</div>