Check out example codes for "CSS technique for a horizontal line with icons in the middle". It will help you in understanding the concepts better.

Code Example 1

h2 {
  text-decoration: line-through;

Code Example 2

<h1>This is a longer heading</h1>

h1 {
  overflow: hidden;
  text-align: center;

h1:after {
  background-color: #000;
  content: "";
  display: inline-block;
  height: 1px;
  position: relative;
  vertical-align: middle;
  width: 50%;

h1:before {
  right: 0.5em;
  margin-left: -50%;

h1:after {
  left: 0.5em;
  margin-right: -50%;

Learn ReactJs, React Native from