Does what it should in IE6 and FF2, but not in Safari? Or I'm doing it wrong? According to the w3c validators the html and css is valid, but #box doesn't change its vertical position in Safari.Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test</title> <style type="text/css"> * { margin: 0; padding: 0; } html, body { width: 100%; height: 100%; } #container { width: 100%; height: 100%; background-color: #CCCCCC; } #box { width: 300px; height: 300px; margin: auto; position: relative; top: 50%; background-color: #999999; } </style> </head> <body> <div id="container"> <div id="box"></div> </div> </body> </html>



Reply With Quote


Bookmarks