Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Centering a google map


read1

Question

7 answers to this question

Recommended Posts

  • 0
2 minutes ago, read1 said:

Site URL: https://www.betterbasics.org/book-nook

I used custom code to upload a google map to a webpage.  How do I center the map? It is shifting to the left margin.

Thank you,

Please add this to Design->Custom Css

#block-yui_3_17_2_1_1604956736194_7123 iframe {
      margin: 0 auto;
      display: block;
      width: 100%;
}

image.thumb.png.00f23277da7cc8d45b4946b18de5818b.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
On 11/13/2020 at 3:58 PM, bangank36 said:

Please add this to Design->Custom Css


#block-yui_3_17_2_1_1604956736194_7123 iframe {
      margin: 0 auto;
      display: block;
      width: 100%;
}

image.thumb.png.00f23277da7cc8d45b4946b18de5818b.png

bangank36 thank very much for this. I have searching for the css for this for 2 days and this works perfectly.

Link to comment
  • 0
10 minutes ago, IvanOB said:

bangank36 thank very much for this. I have searching for the css for this for 2 days and this works perfectly.

Can i also check if there is a way to do this with one entry for all google maps rather than individually using their block ids? I can't work out the specific embed-block identifier to use.

Link to comment
  • 0
1 hour ago, IvanOB said:

Can i also check if there is a way to do this with one entry for all google maps rather than individually using their block ids? I can't work out the specific embed-block identifier to use.

try

.sqs-block-content iframe {
      margin: 0 auto;
      display: block;
      width: 100%;
}

and remove or resize space to col-1

image.thumb.png.977e7c814a8e007a5919a1b949e97c66.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0

@IvanOB Hi. I see same problem on Tablet.

You can use this CSS for tablet

/* center map */
@media screen and (max-width:991px) and (min-width:768px) {
div#block-yui_3_17_2_1_1605281700671_15297+.row .span-10 {
    width: 100%;
}
div#block-yui_3_17_2_1_1604956736194_7123 {
    text-align: center;
}
}

image.thumb.png.7605ef8d22af1ba2de81bee313aa8d77.png

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

Link to comment
  • 0
On 3/30/2021 at 8:56 AM, tuanphan said:

@IvanOB Hi. I see same problem on Tablet.

You can use this CSS for tablet


/* center map */
@media screen and (max-width:991px) and (min-width:768px) {
div#block-yui_3_17_2_1_1605281700671_15297+.row .span-10 {
    width: 100%;
}
div#block-yui_3_17_2_1_1604956736194_7123 {
    text-align: center;
}
}

image.thumb.png.7605ef8d22af1ba2de81bee313aa8d77.png

Thanks @tuanphan 

I used @bangank36 code for the desktop and some tips from another youtube video to tailor the nobile view as below, which works fine so far in my testing. Just finishing off my first blog so will get a couple of friends to test out before publishing to make sure the page works on different devices

/* center blog google embedded map */
.sqs-block-content iframe {
      margin: 0 auto;
      display: block;
      width: 100%;
}

/*  make blog google map size smaller on mobile screen*/
@media only screen and (max-width: 767px) {
.sqs-block-content iframe {
      margin: 0 auto;
      display: block;
      width: 80%;
  height: 50vh!important;
}
}

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