<div class="hero flex-center">
  <div class="hero-message">
    <h1 class="hero-title">The Hero Title</h1>
    <h2 class="hero-sub-title">
      This is the Sub-Title to Add Context
    </h2>
  </div>
</div>
<div class="not-hero flex-center">
  <div class="not-hero-message">
    <h1 class="not-hero-title">Not the Hero Title</h1>
  </div>
</div>
* {
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
}

.hero {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  position: absolute;
}

.hero::before {
  background-image: url(http://www.philippefercha.com/cd/toggle-menu-bg.jpg);
  background-size: cover;
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.4;
}

.flex-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
}

.hero-message {
  color: #fff;
  text-shadow: #343a40 2px 2px;
  min-width: 100%;
  min-height: 12em;
  position: relative;
}

.hero-message::before {
  content: "";
  display: block;
  position: absolute;
  margin-left: 0;
  min-width: 100%;
  min-height: 12em;
  z-index: -1;
  opacity: 0.4;
  background-color: #343a40;
}

.hero-title,
.hero-sub-title {
  width: 100%;
  display: block;
  text-align: center;
}

.hero-title {
  margin: 3% 0;
  text-transform: uppercase;
}

.hero::after {
  background-color: #563d7c;
  content: "";
  display: block;
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.4;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.