Jump to content

Remove horizontal scroll from mobile

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://noahlangphotography.com/blog/how-to-get-enchantment-permits-leavenworth-washington

On a desktop and in the little squarespace mobile window it says that x-overflow is working from the code I applied below until I actually visit the site on a phone and there's clearly still horizontal scrolling. Any idea on what I'm missing ?

 

body {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

 

Thanks

Link to comment
  • 1 year later...
On 6/17/2023 at 11:04 AM, noahawaii said:

This code used to work 

html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

but now it only works some of the time on mobile blog pages. See this one for example. In some browsers the overflow is hidden and for some it isn't but only on blog pages.

https://noahlangphotography.com/blog/lualualei-lookout-trail-oahu-hawaii

You try disable code in Code Injection and check again

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
7 hours ago, tuanphan said:

You try disable code in Code Injection and check again

I've narrowed down the issue to pages with these product widgets, which I need on my website, but I'm struggling to figure out exactly what's overriding the CSS to see how to prevent it.

<script type="text/javascript" src="//www.avantlink.com/product_ad_widget/paw.php?pawid=168457&amp;pw=302869&amp;output=js"></script> 

That link above is one of those with the product widget.

Link to comment

This is the closest I've gotten but it's not a solution because it applies to everything. Even the header. 

* {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

However, this should work, but it doesn't 

* section[data-section-id="63e6a2ba7302361813434e9f"] {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

 

Link to comment
  • 1 month later...

I have spoken to support and they mentioned some code in the code injection was making this happen. I have already cleared and checked every code possible and yet this problem persists on android and iphone devices. Is there anyone who can help me?

www.ericjasondsouza.com
password: Reflection9876!

 

Screenshot 2023-08-19 at 2.05.06 AM.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.