JSFiddle - React, Tailwind, and code Playground
HTML
<div id="entire-Header">
<h2 id="the-h2-Title">
<div id="headlineTextbox">This is a Test Headline</div>
</h2>
<div id="the-lines"> </div>
<img id="the-logo" src="http://placehold.it/150x60">
</div>
CSS
#entire-Header{
position: relative;
width: 100%;
height:40px;
}
#the-h2-Title {
position: relative;
float: left;
width: auto;
padding-right: 10px;
}
#the-lines {
border-top: 4px solid #000000 !important;
border-bottom: 4px solid #000000 !important;
height: 1px;
float: left;
margin-top: 23px;
min-width: 400px;
}
#the-logo {
position: relative;
max-width: 160px;
max-height: 50px;
float: right;
width: auto;
height: auto;
top: 0;
}
JavaScript
function sizeLines() {
var logoSize = document.getElementById("the-logo").offsetWidth;
var titleWidth = document.getElementById("the-h2-Title").offsetWidth;
var totalWidth = document.getElementById("entire-Header").offsetWidth;
var offsetWidth = (logoSize + titleWidth);
var linesWidth = (totalWidth - offsetWidth - 20) + "px";
document.querySelector("#the-lines").style.width = linesWidth; }
window.onresize = sizeLines;