[英]Is this possible to make the child dom element to have visible overflow when parent container element has overflow scroll?
I have a modal component which should have scrollable content.我有一个模态组件,它应该有可滚动的内容。
On that modal component I have a datepicker input, which should popup a datepicker and this popup should be visible even when it is outside of the container component block.在那个模态组件上,我有一个 datepicker 输入,它应该弹出一个 datepicker 并且这个弹出窗口应该是可见的,即使它在容器组件块之外。
Is this possible to make datepicker component to have visible overflow when the parent has overflow: scroll?当父级溢出时,这是否可以使 datepicker 组件具有可见的溢出:滚动?
I have tried to use position: absolute but this doesn't help for my case我尝试使用 position: absolute 但这对我的情况没有帮助
You can use position absolute
您可以使用
position absolute
But you have to remain careful while positioning because
position: absolute
is not positioned wrt to parent element in this scenario.但是在定位时你必须保持小心,因为在这种情况下
position: absolute
没有定位到父元素。 You can use another container forbox1
andposition
itrelative
您可以为
box1
使用另一个容器并将其relative
position
.box1 { width: 100px; height: 200px; border: 1px solid black; overflow: scroll; } .box2 { width: 200px; height: 100px; border: 1px solid black; position: absolute; }
<div class="box1">Heknasdfsdfffffffffff <div class="box2"></div> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.