Created
April 21, 2016 05:06
-
-
Save d1i1m1o1n/d4182476234daac1d66292a65e249ca3 to your computer and use it in GitHub Desktop.
How to center absolute element in div?
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
<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