Note that you have your <p>
elements relatively positioned and shifted right with right: -450px
.
With position: relative
the original space for the element is reserved. So while you’re shifting the element rightward 450px, its original space in the layout is kept intact, and the document is lengthened horizontally. That’s the reason for the scrollbar.
Remove or adjust the right: -450px
rule to see the difference.
Also, simply for contrast, switch relative
with absolute
positioning, which removes the element from the document flow, and the original space is eliminated.