Jump to content

Help resizing iFrames for mobile

Recommended Posts

  • Replies 14
  • Views 3.8k
  • Created
  • Last Reply
Posted

@rwp - sorry, it's now live!

I've actually figured it out, but I'm having a problem with 2 pages in particular.

https://www.planetsyz.com/mindforms - this embedded player looks perfect on desktop, but awful on mobile. I have tried setting the width to 100% (which works on all of the others pages) but when I do that, it looks perfect on mobile and TINY on desktop!

I also have https://www.planetsyz.com/sound-design which is showing perfectly on desktop, but the embedded videos are showing tiny on mobile. 

Any ideas on these?

Thanks so much!

Posted

It looks like the codeblock is only 25% of the width. You should be able to edit that in the editor to make it 50% by dragging it wider.

Drag the left side towards the text block, so they are both the same width.

Posted

@rwp - ah OK - I just tried that and it also looked fine on mobile, but still way too big on mobile.

I'm so stuck!

Perhaps it's something I can edit from the custom css area? At current, this CSS is in therre:

 }
iframe {
    width: 100%;
    height: 100%;
    margin: 0px;
    padding: 0px;
    background: none;
    border: 0px;
    display: block;
   }}

Posted

For the second one, the height: 100% is shrinking it.

The iframe tag says height=540

Try this in the max-width: 991px code block

iframe {

height: 540px

}

Posted
3 minutes ago, tuesdayroo said:

@rwp - ah OK - I just tried that and it also looked fine on mobile, but still way too big on mobile.

I'm so stuck!

Perhaps it's something I can edit from the custom css area? At current, this CSS is in therre:

 }
iframe {
    width: 100%;
    height: 100%;
    margin: 0px;
    padding: 0px;
    background: none;
    border: 0px;
    display: block;
   }}

If you do width: 100% !important; it will fix it. Then that column only being 25% wide will become visible.

If you make them both 50% and do the !important, it might be closer to what you are after.

Posted

Dynamically, you can't.

You can set up css to change it to a fixed height based on screen width, but you can not get the content height of an iframe of a page that is part of another website. I have been trying to figure out a work around for another project and it just doesn't seem possible.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.