Instantly share code, notes, and snippets.

Embed
What would you like to do?
Centered block element with unknown width
<div id="container">
<div id="element">
centered content
</div>
</div>
#container {
text-align: center;
}
#element {
text-align: left;
display: inline-block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment