gpt4 book ai didi

css - Google Chrome - 绝对定位的 DIV 上的 z-index 问题

转载 作者:行者123 更新时间:2023-11-28 05:29:37 25 4
gpt4 key购买 nike

所以我有一个“开发中”的网站,我在 Google Chrome 中看到一个奇怪的问题(Edge/Internet Explorer 没有显示这个错误,但按预期工作,这是第一次!)

用于在标题图像中循环的两个“下一个”和“上一个”控件的 z-index 为 666 并且左右浮动,但谷歌浏览器似乎没有检测到 a) 悬停事件,b)点击(据我所知)。不知道是不是和header底部的菜单有关...

如有任何帮助,我们将不胜感激!

CSS 代码如下:

#header #coverControls-prev,
#header #coverControls-next {
position: relative;
height: 100%;
width: 100px;
background-color: rgba(0,0,0,0.0);
opacity: 0.25;
text-align: center;

transition: opacity 0.5s ease-in-out, background-color 0.5s ease-in-out;
z-index: 666;
}

#header #coverControls-prev:hover,
#header #coverControls-next:hover {
background-color: rgba(0,0,0,0.25);
opacity: 1;
}

#header #coverControls-prev {
float: left;
clear: none;
}

#header #coverControls-next {
float: right;
clear: none;
}

#header #coverControls-prev p,
#header #coverControls-next p {
display: block;
position: absolute;
top: 50%;
margin-top: -50%;

width: 100%;

font-size: 10vmin;
text-align: center;
z-index: 667;
}

#menu {
position: absolute;
bottom: 0;
left: 0;

display: block;

padding: 5px 2vw;
height: 3em;
width: 100vw;

background-color: rgba(255,255,255,0.5);
text-align: left;
white-space: nowrap;
overflow: hidden;
color: #000000;

z-index: 777;
}

有问题的网站:http://dev1.deliriousdreams.co.uk/

最佳答案

将此添加到您在 css 中的 a 标签。您的 anchor 标记需要宽度和高度。 display:block 允许您为 anchor 标记添加宽度和高度。

width: 100px;
height: 100px;
display: block;

关于css - Google Chrome - 绝对定位的 DIV 上的 z-index 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38580967/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com