Skip to content

Instantly share code, notes, and snippets.

@themorgantown
Created March 25, 2014 21:17
Show Gist options
  • Save themorgantown/9771603 to your computer and use it in GitHub Desktop.
Save themorgantown/9771603 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="chrome=1,IE=9" http-equiv="X-UA-Compatible" />
<meta content="user-scalable=yes, width=650" name="viewport" />
<title></title>
<style type="text/css">
*{
margin:0;
padding:0;
}
body {
height:1156px;
}
.centered{
background-color:black;
color:white;
width:650px;
height:185px;
position:absolute;
text-align:center;
left:50%;
top:50%;
margin:-92px 0 0 -325px;
/* 92 is about half of the height of 185, and 325 is half of 650, the width. */
}
</style>
</head>
<body>
<div class="centered">
This content is centered.
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment