【问题标题】:Kube CSS grid not responsive on mobileKube CSS 网格在移动设备上没有响应
【发布时间】:2015-09-26 19:21:40
【问题描述】:

我正在使用Kube CSS framework,但响应式网格出现问题。

我有这样的html,取自第一个例子here

<body>

  <div class="units-row">
      <div class="unit-50">Hello world</div>
      <div class="unit-50">It's Kube Grid System</div>
  </div>

  <style>
    .unit-50 {
      text-align: center;
      background-color: purple;
      color: white;
      padding: 2em;
    }
  </style>

</body>

桌面上的示例中的页面渲染器相同

问题是当我在移动设备上时。当我在 Kube 网格示例上打开 chrome 开发工具时,列是响应式的并且宽度为 100%。

这就是我的页面在移动设备上的样子

在 Kubes 网格示例中,当屏幕宽度为 375 像素时,我的屏幕宽度似乎 > 900 像素。我没有加载任何会修改它的外部 css。

我知道我的网站仍然是响应式的,因为当我调整浏览器窗口的大小时,列的宽度确实是 100%。

由于某种原因,在移动设备上我的屏幕宽度比在 Kube CSS 网站上高得多。我需要做任何事情来使我的页面以这种方式运行吗?

这真的让我很困惑,因为它看起来应该可以工作。

【问题讨论】:

    标签: html css mobile responsive-design kube-css


    【解决方案1】:

    因此,经过数小时的谷歌搜索(请注意,您可能只需几分钟就可以搜索到正确的内容),将这个元标记放在文档的头部

    <meta name="viewport" content="width=device-width, initial-scale=1">
    

    将使网格在移动设备上响应

    【讨论】:

    猜你喜欢
    • 2019-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-22
    • 1970-01-01
    • 1970-01-01
    • 2015-09-16
    • 2014-09-24
    相关资源
    最近更新 更多