Add centered text to the middle of a horizontal rule [duplicate]
How about: <div style=”width: 100%; height: 20px; border-bottom: 1px solid black; text-align: center”> <span style=”font-size: 40px; background-color: #F3F5F6; padding: 0 10px;”> Section Title <!–Padding is optional–> </span> </div> Check out this JSFiddle. You can use vw or % to make it responsive.