Jump to content

Embed code to enable integrated Google Map to size more mobile version

Recommended Posts

Hi, I'm also trying to learn how to do this on my site (no previous experience in web building).

I have a custom google map, but would like the code to resize for smaller screens.

This is the link to the page - the password is " ASHS "

https://olive-rhombus-8z34.squarespace.com/members-map

 

This is the current code I'm using for the map.

 

<div style="width: 900px; overflow: hidden; height: 700px;">
<iframe
  src="https://www.google.com/maps/d/u/0/embed?mid=1oAOvKyk8UZsgrVZGgijdSgS5D0SfRMQ&ehbc=2E312F"
  width="900px" 
  height="900px"
  frameborder="0"
  style="border:0; margin-top: -65px;">
</iframe>
</div>
 

 

 

I hope you can help! 

Link to comment
On 1/28/2024 at 8:18 PM, jjjcb said:

Hi, I'm also trying to learn how to do this on my site (no previous experience in web building).

I have a custom google map, but would like the code to resize for smaller screens.

This is the link to the page - the password is " ASHS "

https://olive-rhombus-8z34.squarespace.com/members-map

 

This is the current code I'm using for the map.

 

<div style="width: 900px; overflow: hidden; height: 700px;">
<iframe
  src="https://www.google.com/maps/d/u/0/embed?mid=1oAOvKyk8UZsgrVZGgijdSgS5D0SfRMQ&ehbc=2E312F"
  width="900px" 
  height="900px"
  frameborder="0"
  style="border:0; margin-top: -65px;">
</iframe>
</div>
 

 

 

I hope you can help! 

Use this under your code

<style>
  @media screen and (max-width:767px) {
  iframe[src*="google.com/maps"] {
    width: 100% !important;
    height: 300px !important;
}
  }
</style>

 

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
  • 2 months later...
On 4/7/2024 at 10:18 AM, lawi227 said:

@tuanphan Can you help me clean up the google map as well? I'd like to remove the header and resize to fit the green container box.

oystermanor.com

password: earlyaccess

You can use this code to Website > Website Tools > Custom CSS

div#block-yui_3_17_2_1_1711636117865_8248 .embed-block-wrapper {
    overflow: hidden;
    padding-bottom: 90% !important;
}
div#block-yui_3_17_2_1_1711636117865_8248 iframe {
    width: 100% !important;
    top: -70px;
}

 

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

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.