位置绝对和溢出隐藏 [英] Position absolute and overflow hidden
问题描述
我们有两个DIV,一个嵌入另一个。如果外部DIV不是绝对位置,则位于绝对位置的内部DIV不遵守外部DIV的溢出隐藏(示例)。
We have two DIVs, one embedded in the other. If the outer DIV is not positioned absolute then the inner DIV, which is positioned absolute, does not obey the overflow hidden of the outer DIV (example).
有可能使内部DIV服从外部DIV的溢出隐藏,而不将外部DIV设置为绝对位置我们完整的布局)?
对于我们内部DIV的位置相对位置也不是一个选项,因为我们需要展开一个表TD( exmple )。
Is there any chance to make the inner DIV obey the overflow hidden of the outer DIV without setting the outer DIV to position absolute (cause that will muck up our complete layout)? Also position relative for our inner DIV isn't an option as we need to "grow out" of a table TD (exmple).
有没有其他选择?
推荐答案
外部< div>
到 position:relative
和内部< div>
到 position:absolute
。它应该为你工作。
Make outer <div>
to position: relative
and inner <div>
to position: absolute
. It should work for you.
这篇关于位置绝对和溢出隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!