HTML DIV element Disappears with no content

When the div is empty the element has no height. So what's actually happening is that it's there but has 0 height.

You could put something in it (like   or give it height and/or line-height. I'd suggest giving the other div the same height.


Another thing that call cause this is improperly nested tags or tags that are not closed.

Make sure all tags are properly nested and closed.


Put a non-breaking space in it. That's what I do when I need something, but not nothing. You may also be able to give it an explicit height to get the same result.


Make sure the contains some kind of content.   is usually the best. It ensures that there is at least something for the browser to display/render. This also might be a cause of your DTD.

Tags:

Html

Css

Layout