pavinder
04-12-2006, 06:47 PM
After searching, reading and following coding suggestions from many threads about vertical centreing with CSS, I still have a single problem with a page.
It displays perfectly in Safari and Firefox, but with Windows/IE (always bl***y Windows/IE....) the page is not centred vertically but is stuck to the bottom of the window.
The page is at:
http://moonmilk.org/temp/index.htm
The CSS is at:
http://moonmilk.org/temp/styles/endless.css
(the relevant css in that file is:
html, body {
margin:0;
padding:0;
border:0;
height:100%;
font-size:0.85em;
font-family:Verdana, Arial, Helvetica, sans-serif;
color:#000000;
}
#centred {
position:relative;
display:table;
width: 80%;
max-width: 1000px;
min-height:100%;
vertical-align: middle;
text-align: center;
border-left: 0px solid #a4c3bd;
border-right: 0px solid #a4c3bd;
background-color: #000000;
margin: 0 auto;
}
#content {
width:100%;
display:table-cell;
vertical-align:middle;
position:relative;
}
#centred {
height:100%;
}
#content {
top:50%;
left:0;
}
and in the page I use:
<div id="centred">
<div id="content">
<!-- main table with all content -->
</div>
</div>
This has me stumped....IE on Windows doesn't like this....any help appreciated.
Thanks in advance.
It displays perfectly in Safari and Firefox, but with Windows/IE (always bl***y Windows/IE....) the page is not centred vertically but is stuck to the bottom of the window.
The page is at:
http://moonmilk.org/temp/index.htm
The CSS is at:
http://moonmilk.org/temp/styles/endless.css
(the relevant css in that file is:
html, body {
margin:0;
padding:0;
border:0;
height:100%;
font-size:0.85em;
font-family:Verdana, Arial, Helvetica, sans-serif;
color:#000000;
}
#centred {
position:relative;
display:table;
width: 80%;
max-width: 1000px;
min-height:100%;
vertical-align: middle;
text-align: center;
border-left: 0px solid #a4c3bd;
border-right: 0px solid #a4c3bd;
background-color: #000000;
margin: 0 auto;
}
#content {
width:100%;
display:table-cell;
vertical-align:middle;
position:relative;
}
#centred {
height:100%;
}
#content {
top:50%;
left:0;
}
and in the page I use:
<div id="centred">
<div id="content">
<!-- main table with all content -->
</div>
</div>
This has me stumped....IE on Windows doesn't like this....any help appreciated.
Thanks in advance.