垂直水平都居中
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>CSS垂直水平都居中 站長學院www.pigzz.com</title>
<style type="text/css">
<!--
.main{ position:absolute; top:50%; left:50%; width:560px; height:188px; margin:-94px 0 0 -280px; background:red}
-->
</style>
</head>
<body>
<div class="main">站長學院www.pigzz.com 提示:紅色部分是一個垂直水平都居中的div</div>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.