【问题标题】:How to change the Iframe map size to full screen in Shopify Atlantic theme如何在 Shopify Atlantic 主题中将 Iframe 地图大小更改为全屏
【发布时间】:2019-10-21 16:55:13
【问题描述】:

我正在使用大西洋主题,并为地图创建了一个新页面。 我使用了下面提到的以下代码

<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d27728.56583382997!2d-95.647502!3d29.688729!3m2!..." width="800" height="600" frameborder="0" style="border:0;" allowfullscreen="">

请帮我把它变成全尺寸,我已经使用了创建新布局的方法,但它仍然不起作用。 它仅在我编写布局时才起作用 null {% layout none %} 但我想要它的主题 我不想让布局为空。 下面附上截图

【问题讨论】:

    标签: google-maps shopify customization shopify-template


    【解决方案1】:

    使用 CSS 将&lt;iframe&gt; 的高度和宽度设置为 100%:

    html, body, iframe {
      height: 100%;
      width: 100%;
      padding: 0px;
      margin: 0px;
    }
    

    proof of concept fiddle

    代码 sn-p:

    html,
    body,
    iframe {
      height: 100%;
      width: 100%;
      padding: 0px;
      margin: 0px;
    }
    <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3466.07056567071!2d-95.64969038455021!3d29.688733742242416!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x8640df708f47547b%3A0x21b117877ecdc1e7!2sMW%20Furniture%20Outlet!5e0!3m2!1sen!2sus!4v1571677313661!5m2!1sen!2sus"
      frameborder="0" style="border:0;" allowfullscreen=""></iframe>

    【讨论】:

    • 你定义了所有包含元素的大小吗?
    猜你喜欢
    • 1970-01-01
    • 2018-12-23
    • 2018-11-08
    • 2016-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-08
    • 2016-02-10
    相关资源
    最近更新 更多