
Originally Posted by
franko
OOPS! Sorry about that. Amazing how preconceptions can colour one's reading. Never occurred to me somebody would want to centre a web page vertically. A popup window, yes, but a web site I've never seen before.
You have to use absolute positioning and changing the doctype can stop it working, which is probably the reason it worked in 7.5 but not in 2015. 2015 uses the html 5 doctype. I don't know what doctype you used with the site. Here's a method that should work with all doctype and browsers using CSS:
#mydiv {
position:absolute;
top: 50%;
left: 50%;
width:30em;
height:18em;
margin-top: -9em; /*set to a negative number 1/2 of your height*/
margin-left: -15em; /*set to a negative number 1/2 of your width*/
border: 1px solid #ccc;
background-color: #f3f3f3;
}
Change the height and width and colours to suite yourself.