<p class="text">This has equal padding on all four sides.</p>
.text {
  /*This centers it in the middle of the page*/
  margin: auto;
  font-size: 20px;
  text-align: center;
  width: 30%;
  border: 2px solid red;

  /*This will add equal padding on all four sides*/
  padding: 10px;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.