I have a simple page, a container div and a title div. The title div is contained in the container (yes I know it's not the best choice in naming but it's not the point here).
The two div have a fixed height (with min height). My target is obtain a vertically centerd page in the browser window. When the browser window is greater than container div height I want the container div vertically centerd in the page. When the browser window is smaller then container div height I want the container div at the top of the page showing its contained div title.
The code I have here works fine with Firefox but has a problem with Safari : when the browser window has an height smaller than content height the title div becomes not visible.
Please, do you have an idea what may be the solution to this problem ? The fiddle is : http://fiddle.jshell.net/D4xWr/
Code;
<body>
<div id="container">
<div id="header_title">
TITLE
</div>
</div>
css
* {
padding:0;
margin:0;}
html,body {
height:100%;
}
body {
font-family:Verdana, Geneva, sans-serif;
font-size:62.5%;
color:#734d08;
line-height:16px;
background-color:#00ffcc;
}
#container{
margin: auto;
position: absolute;
height:80%;
min-height:520px;
width:970px;
min-width:970px;
top: 0; left: 0; bottom: 0; right: 0;
background-color:#00ffcc;
border:1px solid red;
}
#header_title{
background-color:white;
height:70px;
min-height:70px;
width:100%;
border:1px solid;
}