I'm sorry if this is an old issue or a known problem, but I haven't been able to find an answer online. If I have the code
<style>
html, body { height: 100%; width: 100%;}
#div1 {height:50%; min-height:200px;background-color:red;}
#div2 {height:100%; background-color:black;}
</style>
<body>
<div id="div1"><div id="div2"></div></div>
</body>
Then in firefox the black inner div shrinks as the screen shrinks and stops at 200px height. However in a webkit browser the red outer div stops but the inner div continue to shrink as if it was in a parent div without the min-height attribute.
Is there an easy fix to bring the webkit version into line with the firefox rendering? A min-height:inherit
works if placed on the inner div, but in the case of many divs within one this would require min-height:inherit
on each child div. Are there any more elegant solutions?
(Note: as an aside, does anyone now how to escape #'s in code on stackoverflow?)