Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14120 reviews 1680 hosting providers

Questions & Answers

CSS IE9 issue

Apr 11, 2012 by reema40
hi everyone

I have this code in css:
#main {
    height: 100%;
    min-height: 600px;
    background-color:blue;
    overflow: auto;

}
and this html code:
<html>
<head>
<title>My title</title>
<link rel="stylesheet" type="text/css" href="./prova.css">
<body>
<div id="main">

</div>

</body>
</html>

When I resize the window, the scroll bar stops working in IE 9 and the min-height and width don't  match.It works well in Chrome and Firefox. Does anyone know how to fix this IE9 issue?

thanks

1 Answer

0 votes
Apr 11, 2012 by dona
Add the HTML5 Doctype

<!DOCTYPE html>
<html>
<head>
<title>My title</title>
<link rel="stylesheet" type="text/css" href="./prova.css">
<body>
<div id="main">

</div>

</body>
</html>

Also add this to the CSS file

html, body
{
    width: 100%;
    height: 100%;
    margin: 0;
}

This should fix your problem