简体   繁体   English

当父容器元素具有溢出滚动时,这是否可以使子 dom 元素具有可见的溢出?

[英]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 for box1 and position it relative您可以为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.

相关问题 检查子元素在隐藏了溢出的父 div 中是否 100% 可见 - Check if child element is 100% visible inside a parent div that has overflow hidden 使元素在溢出div中可见 - Make Element Visible in an overflow div 如何使子元素粘在父底部而忽略顶部溢出? - How to make child element sticky to parent bottom ignoring top overflow? 识别具有溢出的元素的可见部分 - Identify visible portion of an element which has an overflow CSS position 当父元素隐藏溢出时出现问题 - CSS position issue when parent element has overflow hidden 有可能使孩子超过父母的溢出限制吗? - Is it possible to make child exceed parent' overflow restriction? 我可以将父容器设置为溢出:隐藏但只有特定的子元素表现得好像父容器是溢出的:可见吗? - Can I set the parent container as overflow: hidden but only specific child elements behave as if the parent is overflow: visible? 如果被父元素“剪切”且隐藏了溢出,则删除子元素 - Remove child element if being “cut” by parent element with overflow hidden 是否可以在“ overflow-x:scroll” div容器内证明div元素的可见性? - Is it possible to proof an div element of visibility inside a “overflow-x:scroll” div-container ? 容器中的元素溢出:隐藏; 尽管溢出的宽度更宽,但宽度与父级相同 - Element in container with overflow:hidden; has width same as parent, despite the overflowed width being wider
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM