Skip to content

Instantly share code, notes, and snippets.

@malachi358
Created May 27, 2013 06:39
Show Gist options
  • Save malachi358/5655495 to your computer and use it in GitHub Desktop.
Save malachi358/5655495 to your computer and use it in GitHub Desktop.
center div with absolute property
<body>
<div style="position: absolute; left: 50%;">
<div style="position: relative; left: -50%; border: dotted red 1px;">
I am some centered shrink-to-fit content! <br />
tum te tum
</div>
</div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment