.container {
width: 20em;
margin-left: auto;
margin-right: auto;
}Box alignment for block, absolutely positioned, and table layouts
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.