JSFiddle - React, Tailwind, and code Playground

by cvalleskey

HTML

<h1 data-text="Header Title That Splits To Two Seperate Lines"></h1>
<p>The plans you refer to will soon be back in our hands. I'm surprised you had the courage to take the responsibility yourself. I don't know what you're talking about. I am a member of the Imperial Senate on a diplomatic mission to Alderaan-- What?! I don't know what you're talking about. I am a member of the Imperial Senate on a diplomatic mission to Alderaan-- I suggest you try it again, Luke. This time, let go your conscious self and act on instinct.</p>

CSS

body {
    font: 14px/20px Helvetica Neue, sans-serif;
    padding: 30px;
}
h1[data-text] {
    font-size: 2em;
    line-height: 1.2em;
    text-align: center;
    position: relative;
    padding: 0 40px;
    margin-bottom: 1em;
}
h1[data-text]:before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    border-top: 1px dotted #DDD;
    z-index: 1;
}

h1[data-text]:after {
    content: attr(data-text);
    padding: 0 15px;
    background: #FFF;
    z-index: 2;
    position: relative;
    display: inline-block;
}