我可以在背景上显示 DIV 图库吗?
我目前正在使用 nivo-slider,问题是,我想要在背景中显示图片。我有立场:绝对但它不起作用。画廊本身位于顶部位置,所有其他 div 都位于其后面。 有什么解决办法吗?
I'm currently using nivo-slider here the problem is, I want the displayed pictures in a background. I have position:absolute but its not working. The gallery itself is in top position and all other divs are behind it.
Is there any solution for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为此使用 css 属性 z-index 对
要显示在背面的元素使用较低的 z-index,例如
z-index:1
,对要显示在顶部的元素使用较高的 z-index
z-index:10
Use css property z-index for this
Use lower z-index for the element you want to appear on the back like
z-index:1
and use higher z-index for the elements you want to appear on top
z-index:10
对不想在幻灯片顶部显示的元素设置更高的 z-index。为了获得完整的跨浏览器支持,请确保将该元素放置在代码中的幻灯片之后。
Set a higher z-index on the elements you wont to show on top of the slideshow. For full cross browser support make sure that the element is placed after the slideshow in the code.
为幻灯片元素添加 z-index,而要在背景中显示的元素则不添加 z-index。
例如
add z-index to the slideshow element , while the element to be displayed in background leave it without z-index.
for example