将 html 元素定位在 javascript 元素之上

Positioning of an html element over a javascript one

这是我正在处理的网站:http://labbrini.netsons.org 在它的左侧我有一个 div (#puntate),它应该在 javascript 的顶部大嘴唇标志(#logo)出现在一切之上。当然,我需要#puntate 的链接即使在徽标显示在其上时也可以点击。 z-index 不适用于此。有人可以帮我这个定位吗?

在我的浏览器中检查您的代码时,我看到您正在使用 px 作为 z-index

不要给z-index

任何单位

在你的CSS中,替换

z-index: 900px;

z-index: 900;

docs

中所述

The z-index property specifies the z-order of an element and its descendants.

而且,订单没有单位。因此不需要任何单位。任何具有更高 z-index 的元素都将位于其他元素之上。

谢谢大家。 z-index 的值是我的愚蠢错误。但是为了得到我想要的东西,我需要做更多的修补。我创建了另一个 div #left2

<div id="left"></div>
<div id="left2"><div id="puntate"><ahref="http://labbrini.netsons.org/Labbrinip1"> 
Labbrini p.1 - Lorem ipsum dolor sit amet</a><br/> 
</div></div>

所以我的 div 问题 (#puntate) 属于新的,我将背景颜色设置为透明,以便在旧的下方看到颜色过渡:

#left2 {
background-color : transparent;
position:fixed;
display: table;
z-index:1000;
width:50%;
height:100%;
position:fixed;
bottom:0;
left:0;
}

当然,#puntate 的 z-index 设置为比#logo

更高的值

很抱歉之前没有发布代码。