【问题标题】:Forcing screen layout with Zurb-Foundation使用 Zurb-Foundation 强制屏幕布局
【发布时间】:2013-07-26 07:13:56
【问题描述】:

在移动设备上查看布局时,有没有办法强制布局从横向更改为纵向?我有一个带有大桌子的页面,当在移动设备上查看时,它会切断桌子。我希望它在移动设备上自动锁定垂直方向,以便表格正确显示。

我知道我可以检测屏幕尺寸并执行我自己的媒体查询,但我如何强制改变布局?

【问题讨论】:

    标签: zurb-foundation


    【解决方案1】:

    来自官方文档:

    http://foundation.zurb.com/docs/media-queries.html

    CSS:

    /* Apply styles to screens in landscape orientation */
    @media only screen and (orientation: landscape) {}
    
    /* Apply styles to screens in portrait orientation */
    @media only screen and (orientation: portrait) {}
    

    Sass/SCSS:

    /* Apply styles to screens in landscape orientation */
    @media #{$landscape} { }
    
    /* Apply styles to screens in portrait orientation */
    @media #{$portrait} { }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-08
      • 2013-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多