z 索引 div 上的链接不是链接?
我在主div后面有一个div。有时它会出现,有时会被遮挡,这没关系。但该 z 索引 div 上的链接未显示为链接。也就是说,浏览器不会将光标变为指针;而是将光标变为指针。当您单击它时,它不会请求 href 文档。
有什么方法可以保留 div,以便在调整浏览器大小时它被遮挡,但仍然为我们提供链接?
I have a div behind the main div. Sometimes it appears and sometimes it's occluded, and that's fine. But the link on that z-indexed div isn't showing up as a link. Which is to say, the browser doesn't turn the cursor to a pointer; and when you click on it, it doesn't request the href document.
Is there any way to keep the div so that it gets occluded when the browser is resized, but still gives us the link?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我发现问题了。
我使用的是负 z-index 值,这会将 div 放在 body 后面,因此无法访问。当我对主 div 和背景 div 使用相同的相对值,但将它们设置为正值时,一切都有效。
希望这对其他人有帮助。
OK, I found the problem.
I was using negative z-index values, which puts the div behind the body and is therefore unreachable. When I used the same relative values for main div and background div, but made them positive, it all worked.
Hope this helps someone else.