<div class="box">
  <h1>Заголовок</h1>
  <p>подтекст</p>
</div>
.box {
  border:1px solid black;
  border-top: unset;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  flex-flow: column;
  width: 300px;
  height: 200px;
}
.box:after,
.box:before {
  position: absolute;
  width: 30%;
  height: 1px;
  top: 0;
  content:'';
  left:0;
  background: black;
}
.box:before {
  left: unset;
  right: 0;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.