【问题标题】:Three divs in a responsive iframe响应式 iframe 中的三个 div
【发布时间】:2013-05-09 09:42:38
【问题描述】:

我有三个divs 和这个谷歌地图iframe 代码与以下CSS:

#contact_map { border-radius: 200px; width: 320px; height: 320px; overflow: hidden; max-width: 100%; position: relative; right: 0px; }
#contact_map_fake { border-radius: 200px; width: 320px; height: 320px; top:0px;
    box-shadow: inset 0px 3px 5px 1px rgba(0, 0, 0, .5); pointer-events:none; position: absolute; border: 1px solid rgba(255,255,255,.6);
}
#contact_map_container { border-radius: 200px; overflow: hidden; width: 320px; height: 320px;   }

如何更改 CSS 以使其具有响应性,以便当我在 iPhone 上查看页面时地图跳转到另一个 divs 下?

【问题讨论】:

    标签: html css iframe responsive-design


    【解决方案1】:

    你可以在 css 中使用 @media 标签来做到这一点

    @media screen and (max-width: 480px) and (orientation: portrait){
      /* some CSS here */
      /*define css for all divs*/
    
    }
    
    /* #### Mobile Phones Landscape #### */
    @media screen and (max-width: 640px) and (orientation: landscape){
      /* some CSS here */
      /*define css for all divs*/
    }
    
    /* #### Mobile Phones Portrait or Landscape #### */
    @media screen and (max-width: 640px){
      /* some CSS here */
      /*define css for all divs*/
    }
    

    【讨论】:

    • 你好,我的意思是当你改变大小时在浏览器中。地图必须适应。
    • @Carsten 你告诉我如何更改 CSS 以使其具有响应性,以便当我在 iPhone 上查看页面时地图会跳转到其他 div 下?
    【解决方案2】:

    使用css媒体查询@media

       @media all and (max-width: 640px){
     #contact_map{
    width: 100%;
    height: 100%;
    }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-09
      • 2016-10-07
      • 2019-12-24
      • 1970-01-01
      • 1970-01-01
      • 2019-02-08
      • 2015-12-19
      • 2015-09-23
      相关资源
      最近更新 更多