Jump to content

Resizing Code Blocks for Mobile

Go to solution Solved by Beyondspace,

Recommended Posts

Posted

Site URL: http://www.facilibuildhub.com/

How can I size a code block for mobile? The video on my site is embedded as a code - we didn't want the suggested videos to pop up at the end and I found a tutorial for getting rid of them, which involved embedding it as code. However, the video remains full size on the mobile version and throws off the entire site display. 

Any tips for how to fix this? 

  • Solution
Posted
14 hours ago, meganntab said:

Site URL: http://www.facilibuildhub.com/

How can I size a code block for mobile? The video on my site is embedded as a code - we didn't want the suggested videos to pop up at the end and I found a tutorial for getting rid of them, which involved embedding it as code. However, the video remains full size on the mobile version and throws off the entire site display. 

Any tips for how to fix this? 

Try this custom css

@media screen and (max-width: 767px) {
  #block-yui_3_17_2_1_1614718295210_14318 {
      width: 100% !important;
      padding: 0 !important;
  }  
  #block-yui_3_17_2_1_1614718295210_14318 .sqs-block-content {
       width: 100%;
      padding-top: 56%;
      height: 0;
  }  
  #block-yui_3_17_2_1_1614718295210_14318 .sqs-block-content iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100% !important;
      height: 100%;
  }  
}

image.png.b46a4b773b8cc2364caa261385cf0aac.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

  • 2 weeks later...
  • 3 weeks later...
Posted

Revisiting this conversation as I've run into a new problem - the code works great for changing the size of the video and doing what I need it to do, but I've now realized it's interfering with the site's responsive design. On this page, if you minimize the window, you'll notice that the code block runs into the side bar and everything is overlapping. 

Any idea how to fix this? 

FaciliBuild HUB — FaciliBuild 

image.png.109feb8ab612adcccfb176e6e06fe927.png

Posted
On 4/7/2021 at 2:50 AM, meganntab said:

Revisiting this conversation as I've run into a new problem - the code works great for changing the size of the video and doing what I need it to do, but I've now realized it's interfering with the site's responsive design. On this page, if you minimize the window, you'll notice that the code block runs into the side bar and everything is overlapping. 

Any idea how to fix this? 

FaciliBuild HUB — FaciliBuild 

image.png.109feb8ab612adcccfb176e6e06fe927.png

Add this CSS

/* fix video overlap sidebar */
div#block-yui_3_17_2_1_1614718916914_14873 iframe {
    width: 100% !important;
}

 

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!)

  • 2 years later...
Posted
18 hours ago, Pinnaql3 said:

I'm having a similar issue with HTML code. It's fine on the desktop version. But it's too wide for the mobile version.image.thumb.png.cba4d538166a8b89b7f626830a936d13.png

 

https://theoutsideleverage.com/articles/from-hope-to-heartbreak-how-sean-tuckers-heart-condition-forced-him-to-go-undrafted-in-the-2023-nfl-draft

It looks fine to me

image.png.550b48f086ff27d76378d54956ddeed9.png

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!)

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.