CSS zIndex 的麻烦。里面有链接
晚上好,Stack Overflow,今晚我遇到了一个 CSS 问题。我在视口顶部有一个固定位置的购物车,可以将产品拖放到购物车中。问题是 - 产品出现在购物车后面。我一直在研究所有相关元素的 z 索引和位置,但似乎找不到任何有效的东西。
http://hub.mhn.co/Store/Product/
我承认 CSS 不是对我来说这不是一个强项,我希望有人会看到这个并知道如何解决它。
Good evening Stack Overflow, I've got a css issue tonight. I have a fixed-positioned shopping cart at the top of the viewport, and products can be dragged and dropped into the cart. The problem is - the products are showing up behind the cart. I've been playing with the z-indexes and positions of all of the elements in question and can't seem to find anything that works.
http://hub.mhn.co/Store/Product/
I'll admit CSS isn't a strong point for me, I'm hoping someone will see this and know how to fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还需要为购物车区域分配一个 z 索引。例如,
#cartControl
上的z-index: 1
使其工作正常,因为拖动项目的 z-index 为 10。You need to assign a z-index to the cart area as well. For example,
z-index: 1
on#cartControl
made it work fine since the dragging item has a z-index of 10.