/* The problem */ .off-screen { position: absolute; right: -50px; width: 100px; height: 100px; background-color: red; } /* The solution */ body { overflow-x: hidden; }
<div class="off-screen"></div>