<div class="content">
  <h1>The Title</h1>
  <p>Some text here.</p>
</div>
body::after {
  display: block;
  position: absolute;
  background: #000;
  opacity: 0.8;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  content: '';
}
.content {
  background: #ff0;
  max-width: 50em;
  margin: 2em auto;
  padding: 1em;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.