Is there a way to do this with just css and no scripting? I have a div with a min-width, and inside of it is an absolutely positioned inner div with dynamically generated content of variable width. Sometimes the content extends beyond the containing div, but since its absolutely positioned it won't stretch the containing div. How do i get it to stretch the containing div? Thanks
If your content element has position: absolute
, it is not possible. However, sometimes you can avoid the absolute positioning and yet obtain the desired result by using a floating element instead. See this answer to a very similar question for an example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With