頁面居中的一種,适應絕大多數情況
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DIV+CSS之頁面居中顯示</title>
<style type="text/css">
#container {text-align:center;margin-left:auto;margin-right:auto;width:960px;}
</style>
</head>
<body>
<div id="container">
<div id="header">
Header There........
</div>
<div id="main">
Main There............
<div id="footer">
Footer There ............
</div>
</body>
</html>
本文轉自kefirking 51CTO部落格,原文連結:http://blog.51cto.com/phpzf/782058,如需轉載請自行聯系原作者