JSFiddle - React, Tailwind, and code Playground
HTML
<div class="width100">
<div class="scroll">
<div class="outer">
<div class="border"></div>
<div class="left"></div>
<div class="right"></div>
</div>
</div>
</div>
CSS
.width {
width:100%;
}
.scroll {
overflow-x: scroll;
}
.outer {
width: 960px;
height: 55px;
background-color: orange;
}
.border {
width: 2px;
height: 55px;
margin-left:50%;
position:absolute;
background-color:black; // will be background-image with width: 960px;
}
.left {
float: left;
width: 400px; //varies
height: 55px;
position:relative;
}
.right {
width:560px; //varies
float: left;
height: 55px;
background-color:green; // will be background-image with width: 960px;
}
JavaScript
$('.scroll')[0].scrollLeft = $('.left').width()