To avoid specifying any explicit height, set the CSS min-height property as below -
min-height: 1px;
Other references/options/tricks -
- http://stackoverflow.com/questions/1616879/is-it-possible-to-render-empty-div-style-width50-div-with-css-in-xhtml
- http://stackoverflow.com/questions/6177593/why-does-my-empty-div-collapse-although-it-has-a-width-when-display-inline-is-us
- http://stackoverflow.com/questions/1479239/how-to-force-an-hiddenempty-div-to-take-up-space
*:empty { min-height: 1px; } applies to all elements. Thanks for this!
ReplyDelete