I think that when you have content overflowing a fixed height element, overflowing content does not affect the layout of other elements.
Could you move your content from the top piece of bread and into the meat? This will lead to expansion.
If the content should appear in front of the top background to cut the bread, you can use position: relative and a negative bottom margin to achieve this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <style type="text/css"> #breadtop, #breadbottom { height: 100px; background-color: #977; } #breadtop { overflow: visible; } #meat { background-color: #fbd; } #content { position: relative; top: -100px; margin-bottom: -100px; } </style> <title></title> </head> <body> <div id="breadtop"></div> <div id="meat"> <div id="content"> a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a<br/> a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a<br/> a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a<br/>a </div> </div> <div id="breadbottom"></div> </body> </html>
I like this question because it is rather complicated and because it contains the phrase “extensible meat div”.
Paul D. Waite
source share