Skip to content

Instantly share code, notes, and snippets.

@qianduan
Created December 18, 2012 08:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qianduan/4326240 to your computer and use it in GitHub Desktop.
Save qianduan/4326240 to your computer and use it in GitHub Desktop.
只是文字的水平和垂直居中
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>只是文字的水平和垂直居中</title>
<style>
html,body{width: 100%;height: 100%;margin: 0;padding: 0}
body{background-color: green;display: table;}
p{line-height: 1.6;text-align: center;padding: 0;margin: 0;display: table-cell;vertical-align: middle;}
</style>
</head>
<body>
<p>wording</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment