Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make fixed element obey overflow:hidden

Tags:

css

position

Actually can't quite believe I can't solve this!

How can I get a fixed element to obey the overflow setting?

I have done a fiddle - http://jsfiddle.net/REk4C/7/

enter image description here

In the fiddle and the above image, you'll see a div that contains three divs, each have a different position setting. The relative element obeys the overflow. Now I would expect and can accept that the absolute element to break out, but I need the fixed element to obey the overflow is this possible?

Happy to use jQuery if needed.

like image 285
Alex Avatar asked Dec 11 '25 01:12

Alex


1 Answers

Fixed and absolute positioned elements are taken out of the normal document flow, what means the borders of the original parent container have no influence on the element anymore.

like image 162
Sven Bieder Avatar answered Dec 12 '25 17:12

Sven Bieder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!