Skip to content

Instantly share code, notes, and snippets.

@BigAB
Created November 22, 2012 23:37
Show Gist options
  • Save BigAB/4133332 to your computer and use it in GitHub Desktop.
Save BigAB/4133332 to your computer and use it in GitHub Desktop.
Centered but up a bit
/**
* Centered but up a bit
* For like pages that are just sentences and such
*/
html, body {
position: relative;
height: 100%;
margin: 0;
padding: 0;
border: 0 none;
}
.centered {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
text-align: center;
height: 1%;
/*background: red;*/
}
.main {
position: relative;
top: -3000%;
width: 900px;
max-width: 75%;
margin: auto;
}
.content {
text-align: left;
}
<!-- content to be placed inside <body>…</body> -->
<div class="centered">
<div class="main">
<h1>A great Heading</h1>
<h4>A little bit of sub-text stuff</h4>
<div class="content">
<p>Content blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p>
<p>Content blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p>
</div>
</div>
</div>
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment