<h2>見出しのサンプル</h2>
シンプルに文字を囲む見出しです。
h2 {
  position: relative;
  height: 50px; /*リボンの高さ*/
  line-height: 50px;  /*文字の縦位置*/
  padding: 0 30px;  /*文字の開始位置*/
  color: #ffffff;  /*文字色*/
  font-size: 25px;  /*文字サイズ*/
  background-color: #e53939;
}
h2::before,
h2::after {
  content: '';
  position: absolute;
}
h2::before {
  top: 100%;
  left: 0;
  border-right: 20px solid #9b1e03;
  border-bottom: 20px solid transparent;
}
h2::after {
  top: 100%;
  right: 0;
  border-left: 20px solid #9b1e03;
  border-bottom: 20px solid transparent;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.