简体   繁体   English

z-index无法与溢出重叠和滚动条一起使用

[英]z-index not working with overflow to overlap and scrollbar

I got the following issue: 我遇到以下问题:

I'm trying to display a few <div.content> with content in it. 我正在尝试显示一些带有内容的<div.content> Limited in size to a <div.holder> as parent with overflow set, so that you can scroll down to see all <div.content> . 大小限制为<div.holder>作为具有overflow设置的父级,因此您可以向下滚动以查看所有<div.content> The <div.content> are overlapping the <div.holder> for styling purpose. 所述<div.content>重叠的<div.holder>用于造型的目的。 And everything is wrapped in a <div.container> . 一切都包裹在<div.container>

But the <div.content> won't display over the <div.holder> element with z-index or anything. 但是<div.content>不会显示在带有z-index或其他内容的<div.holder>元素上。 It's rendered inside the <div.holder> element, without scrollbar it's rendered outside, like i want. 它呈现在<div.holder>元素内部,没有滚动条,它呈现在外部,就像我想要的那样。

How can i get the Scrollbar and that the <div.content> will overlap its parent <div.holder> ? 我如何获得滚动条,并且<div.content>将与其父<div.holder>重叠?

Here's the Fiddle for the issue. 这是这个问题的小提琴 Thank you. 谢谢。

EDIT: 编辑:

Trying to accomplish this: 试图做到这一点: 小提琴的Photoshop结果示例

For this styling purpose: 为此目的: 用例

Is this even possible? 这有可能吗? I'm not bound to just use HTML&CSS, just need that thing start working. 我并不仅要使用HTML&CSS,还需要开始工作。

Z-index will only work on elements with position. Z-index仅适用于具有位置的元素。 So its not doing anything to .foo http://www.w3schools.com/cssref/pr_pos_z-index.asp 因此,它对.foo http://www.w3schools.com/cssref/pr_pos_z-index.asp没有任何作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM