Edit in JSFiddle

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  
  height: 300px;
  border: 1px solid blue;
}

p {
  border: 1px solid green;
}
<div class="container">
    <p id="p1"> A paragraph 1 </p>
    <p id="p2"> A paragraph 2 </p>
</div>