Website Building » Squarespace » Can You Do Horizontal Scroll in Squarespace?

Can You Do Horizontal Scroll in Squarespace?

Last updated on December 28, 2022 @ 5:12 pm

Horizontal scroll on Squarespace is definitely possible! You just need to add a little code to your site to make it happen. Here’s how you can do it:

First, you need to create a custom CSS file. To do this, go to the “Design” panel and click on “Custom CSS.” Once you’ve done that, paste the following code into your custom CSS file:

PRO TIP: While horizontal scroll may be possible in Squarespace, it is not recommended as it can cause issues with site functionality and may not be compatible with all Squarespace templates.

@media screen and (min-width: 1000px) {

 .sqs-layout {
    overflow-x: scroll; 
    overflow-y: hidden; 
  }

  .sqs-layout--edges {
    overflow-x: hidden; 
    padding-right: 15px; 
  }  

Next, you need to add some code to your site's header. Go to the "Settings" panel and click on "Advanced."

Then, paste the following code into the "Header Code Injection" box:

<script>$(window).bind("load resize",function(e){var t=$(".sqs-layout");var n=parseInt(t.css("min-width"),10);if(isNaN(n)){n=0}var r=e.currentTarget.innerWidth;if(r>=n){t.addClass("allowScrollX")}else{t.removeClass("allowScrollX")}});</script>

And that's it! Once you've added both pieces of code to your site, you should be able to horizontally scroll your Squarespace site.

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.