<h1>My Banner</h1>


<p>Inspired by <a href="https://codersblock.com/blog/diving-into-the-before-and-after-pseudo-elements/#decorative-ribbon-heading">Will Boyd's Decorative Ribbon Headding.</a>
</p>
h1 {
  position: relative;
  /*   margin: 0 auto 20px; */
  padding: 10px 40px;
  text-align: center;
  background-color: #875e46;
}

h1::before,
h1::after {
  content: "";
  width: 80px;
  height: 100%;
  background-color: #724b34;

  /* position ribbon ends behind and slightly below */
  position: absolute;
  z-index: -1;
  top: 20px;

  /* clip ribbon end shape */
  /* this starts at origin, which is top-left */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 25% 50%);

  /* draw and position the folded ribbon bit */
  background-image: linear-gradient(45deg, transparent 50%, #5d3922 50%);
    background-image: linear-gradient(45deg, transparent 50%, #5d3922);
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: bottom right;
}

h1::before {
  left: -60px;
}
h1::after {
  right: -60px;
  transform: scaleX(-1);
}

p {
  color: black;
  margin: 0 auto;
}

body {
  box-sizing: border-box;
  display: grid;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px 80px;
  color: #fff;
  background-color: #c5e0dd;
  font-family: "Merriweather", serif;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.