Chrome 中的 Z-index 重叠问题
Z-index overlapping issue in Chrome
在我的网站上,当悬停状态处于活动状态时,我为图像设置了 z-index: 1000,这在 firefox 中效果很好,但在 chrome 中却不行。
请检查 gif:放大的图像显示在文本后面,即使文本 z-index 低于 1000。This is wrong and this is what i am trying to archive: showing the image on hover above the text
我做错了什么?
您需要为图像添加 position: relative;
样式规则才能使 z-index: 1000;
有效。
z-index
仅适用于 定位元素 (position:absolute
、position:relative
或 position:fixed
)。
在我的网站上,当悬停状态处于活动状态时,我为图像设置了 z-index: 1000,这在 firefox 中效果很好,但在 chrome 中却不行。
请检查 gif:放大的图像显示在文本后面,即使文本 z-index 低于 1000。This is wrong and this is what i am trying to archive: showing the image on hover above the text
我做错了什么?
您需要为图像添加 position: relative;
样式规则才能使 z-index: 1000;
有效。
z-index
仅适用于 定位元素 (position:absolute
、position:relative
或 position:fixed
)。