<div class="container">
  <div class="image-overlay">
    <img src="https://peakvisor.com/img/news/french-mountains.jpg" alt="France Mountains">
    <div class="image-overlay-content">
      <h1>Image Overlay</h1>
    </div>
  </div>
</div>
* {
  padding: 0;
  margin: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

.container {
  width: 100%;
  height: 100%;
}

.image-overlay {
  width: 100%;
  height: 100%;
  background: black;
  overflow: hidden;
}

.image-overlay img:only-of-type:nth-child(1) {
  object-fit: cover;
  opacity: .4;
}

.image-overlay .image-overlay-content {
  color: white;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%) scale(1.25);
  -moz-transform: translate(-50%, -50%) scale(1.25);
  transform: translate(-50%, -50%) scale(1.25);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.