iPad/iPhone 上的 z 索引问题
首先,我对 CSS/HTML 的经验很少,我不是网页设计师/编码员,基本上我不知道我在做什么。
我也差点自杀了,因为没有任何帮助。我真的很感谢所有试图帮助我的人。
当您访问 pawelpietryka.com 并将鼠标悬停在图像上时,它会通过 webkit 过渡在 div 中滑动,基本上一切正常。
我还使用了一个 webkit 嵌入阴影,它也是动画的。我对这个阴影有很大的问题,因为它总是出现在图像后面(而不是前面)...
#demo-5 img { z-index: -1; position: relative; vertical-align: top; }
一旦我输入 z-index: -1;, 我就用这些更改来破解它。因为它不再适用于 iPad/iPhone,我点击容器但没有任何反应。
(我假设它没有悬停状态,当我尝试点击它时,它在主层后面。)
我在其他页面上看到了这一点,理想的情况是:1)第一个点击框滑入 2) 第二次点击跳转到目的地。
谢谢!
first of all I have very little experience with CSS/HTML, I'm not a webdesigner/coder, basically I have no clue what I'm doing.
I'm also close to kill myself because nothing helped. I really appreciate everyone who's trying to help me.
When you go on pawelpietryka.com and hover on the image it slides in a div via webkit transition and basically everything works.
I'm also using a webkit inset shadow which is animated too. I had big issues with this shadow because it always appeared behind the image (not in front) ... I hacked it with these changes
#demo-5 img { z-index: -1; position: relative; vertical-align: top; }
As soon as I put the z-index: -1; in it doesn't work on iPad/iPhone anymore, I'm tapping on the container and nothing happens.
(I'm assuming it doesn't have a hover state and when I'm trying to tap it it's somehow BEHIND the main layer.)
I've seen this on other page and the ideal scenario would be: 1) First tap box slides in 2) Second tap jump to destination.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您将 div 嵌套视为金字塔,例如...
您无法让级别 2 出现在级别 1 下,因为级别 1包含级别 2。如果您希望级别 2 出现超过 2 级,通常它们是兄弟姐妹,即
但在您的具体情况下,我建议将图像作为 div 的背景
If you think of your div nesting as a pyramid such as...
You can't get level 2 to appear under level 1, because level 1 contains level 2. If you would want level 2 to appear over level 2, usually they would be siblings, i.e
But in your specific case, I would recommend putting the image as the background of the div
试图将其发布在这里,评论的格式很奇怪
Trying to post it here, the formatting is odd on comments
这是“未更改”的代码
And this is the code 'unchanged'