Created
January 31, 2011 01:11
-
-
Save bjhess/803502 to your computer and use it in GitHub Desktop.
Full on centering of a web page: http://news.ycombinator.com/item?id=1209244
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style type="text/css"> | |
html, body { height:100%; margin: 0 auto; } | |
body { display: table; vertical-align: middle; } | |
.column { display:table-cell; vertical-align: middle; } | |
p { text-align: center; } | |
</style> | |
</head> | |
<body> | |
<div class="column"> | |
<p>holy cow!</p> | |
<img alt="shock the monkey" src="http://i.imgur.com/Pt9Pd.jpg" /> | |
<p>it worked!</p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment