Position absolute and overflow hidden

Zardoz picture Zardoz · Jan 5, 2011 · Viewed 160.9k times · Source

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).

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).

Are there any other options?

Answer

shankhan picture shankhan · Jan 5, 2011

Make outer <div> to position: relative and inner <div> to position: absolute. It should work for you.