<div class="container">
  <div class="item">centered</div>
</div>
/* center with flexbox */
html,
body,
.container{
  height: 100%;
}

.container{
	display: flex;
}

.item {
	border: 1px solid black;
  margin: auto;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js