<section>
  <div class="foo">Foo!</div>
</section>
section {
  // Make the example a little easier to see.
  // Flex is not necessary to make this work.   
  display: flex;
  flex-flow: row nowrap;
  justify-content: center;
  padding: 2em;
}

.foo {
  border: 15px solid #efefef;
  box-sizing: border-box;
  height: 300px;
  width: 300px;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.