JSFiddle - React, Tailwind, and code Playground

by Softlink

HTML

<div class="container">
        <div class="block"></div>
    </div>
    <div class="wrap">
        <div class="header"></div>
    </div>

CSS

html, body{
padding:0px;
margin:0px;
width:100%;
height:100% 
}

.wrap{
width:960px;
height:1000px;
margin:0 auto;
background:#ccc;
}


.header{
height:200px;
background:red;
}

.container{
position:absolute;
top:0px;
left:0px;
width:200%;
height:300px;
clip:rect(0px, 10000px, 300px, 0px);/*здесь выставляйте свои параметры, сейчас блок двигается по горизонтальному контейнеру высотой в 300пк*/
}

.block{
background:blue;
width:320px;
height:300px;
position:fixed;
}