六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 57|回复: 0

html页面元素垂直居中的小方法

[复制链接]

升级  55.33%

110

主题

110

主题

110

主题

举人

Rank: 3Rank: 3

积分
366
 楼主| 发表于 2013-2-7 14:39:41 | 显示全部楼层 |阅读模式
我们可以利用表格的垂直居中,然后表格宽高100%就可以了。
代码:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
 
<title>The page is temporarily unavailable</title>
<style>
body { font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head><body bgcolor="white" text="black">
<table height="100%" width="100%">
<tbody><tr>
<td align="center" valign="middle">
The page you are looking for is temporarily unavailable.<br>
Please try again later.
</td>
</tr>
</tbody></table>
</body></html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表