read1 Posted November 13, 2020 Posted November 13, 2020 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,
Beyondspace Posted November 13, 2020 Posted November 13, 2020 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%; } 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
IvanOB Posted March 24, 2021 Posted March 24, 2021 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%; } bangank36 thank very much for this. I have searching for the css for this for 2 days and this works perfectly.
IvanOB Posted March 24, 2021 Posted March 24, 2021 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.
Beyondspace Posted March 24, 2021 Posted March 24, 2021 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 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
IvanOB Posted March 26, 2021 Posted March 26, 2021 On 3/24/2021 at 11:51 PM, bangank36 said: try .sqs-block-content iframe { margin: 0 auto; display: block; width: 100%; } and remove or resize space to col-1 Thanks again bangank36, that works and i appreciate the fast reply
tuanphan Posted March 30, 2021 Posted March 30, 2021 @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; } } 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!)
IvanOB Posted March 31, 2021 Posted March 31, 2021 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; } } 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; } }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.