<div class="flex-center">
  <p>This is a vertically centered multiple lines of text with Flexbox.</p>
body {
  background: #40BDB7;
  font-size: 80%;

div {
  background: white;
  width: 240px;
  margin: 20px;
  border-radius: 5px;

.flex-center {
  background: black;
  color: white;
  border: 10px solid white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 200px;
  resize: vertical;
  overflow: auto;
.flex-center p {
  margin: 0;
  padding: 20px;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.