<p class="line"><span>Start Text here</span><b></b> <span>end text here</p>
.line {
  display: flex;
}
.line b {
  height: 2px;
  background: red;
  margin: 0 2px;
  align-self: center;
  animation: resize 15s infinite;
}
@keyframes resize {
  0% {
    flex-basis: 0%;
  }
  50% {
    flex-basis: 80%;
  }
  100% {
    flex-basis: 0%;
  }
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.