UPDATE 1:
After some experimenting, I discovered that by removing the width:100%
property from the div, I am able to achieve the desired outcome of having a height of 0 when the div is empty. However, I still require the div to have a width of 100%, which seems to be causing it to retain its height even without any content.
You can see the issue for yourself in this jsfiddle. To replicate the problem, try accessing the link using IE7 or possibly even IE6 and older versions.
ORIGINAL QUESTION:
I am facing an issue with an empty div that inexplicably has a non-zero height.
In Chrome, the div remains invisible unless it contains content. But in IE7, the div is displayed even when empty.
Essentially, I want the div to be 0px in height when it has no content, and to automatically adjust its height based on the content it holds. This behavior is only observed when the div does not have a width set to 100%.