Skip to content

Instantly share code, notes, and snippets.

@erotte
Created August 20, 2012 21:14
Show Gist options
  • Save erotte/3407960 to your computer and use it in GitHub Desktop.
Save erotte/3407960 to your computer and use it in GitHub Desktop.
vertically centered with display: box
<!doctype html>
<html lang="de" class="no-js">
<head>
<meta charset="utf-8">
<title>untitled</title>
<meta name="author" content="Eckhard Rotte">
<style type="text/css" media="screen">
html, body {
height: 100%;
}
.inner strong{
display : block;
padding : 10px;
background : #adc;
}
.content{
width : 100%;
height : 100%;
display : -moz-box;
display : -webkit-box;
display : box;
-moz-box-orient : horizontal;
-moz-box-pack : center;
-moz-box-align : center;
-webkit-box-orient : horizontal;
-webkit-box-pack : center;
-webkit-box-align : center;
box-orient : horizontal;
box-pack : center;
box-align : center;
}
</style>
</head>
<body>
<div class="content">
<div class="inner"><strong>vertically centered with display: box</strong></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment