<h2>Centering an Image</h2>

<p>This image is displayed as a block with left and right margin set to auto.</p>

<img src="https://coolhacks.hubskills.com/wp-content/uploads/2018/04/640x360-sales-forecast-PPT-template.png" alt="Centering an Image" />
img {
    display: block;
    margin: 20px auto;
}
h2 {
  text-align: center;
  font: 22px/24px montserrat,sans-serif;
}
p {
  text-align: center;
  font: 15px/18px montserrat,sans-serif;
  color: olive;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.