CSS IE9 issue

692 views
asked Apr 11, 2012 in General by reema40 (820 points)
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 like 0 dislike
answered Apr 11, 2012 by dona (4,540 points)
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
...