Web design: CSS min-height in Internet Explorer
While creating and testing a CSS website template this morning, I found that the content container and footer did not display as intended. The template is for one of my pending projects.
I had created a stylesheet and a basic HTML page with divs, then assigned "min-height=400px;" to the content container. I wanted a minimum height of 400px so the layout would not depend entirely on the amount of content. This was the result:
This was the result:
I took the screenshot in Internet Explorer. I checked the HTML and CSS, and everything looked correct. When I opened the same URL in Firefox, the content container was displayed at 400px as intended. I am new to web development and still learning the basics; this was an example of the differences between browsers.
Internet Explorer ignores "min-height" and assigns 8em when the container has no content. To fix this, define an additional CSS declaration for the container:
| |
Or use this alternative:
| |
That fixed my first problem.