css - ReactJS + Heroku : Why doesn't my website become mobile responsive?

标签 css html reactjs heroku

我最近在 Heroku 上部署了一个 ReactJS 网站,并且相信我拥有网站移动响应所需的一切,但该网站看起来就像在桌面上查看时的样子。在移动设备上查看时,一切都非常小。

可能是什么问题?

这是 HTML:

<html lang="en" class="practice">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <title>Practice Web</title>
    <meta name="description" content="practice">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
    <div id="app"></div>
  <script type="text/javascript" src="/bundle.js"></script></body>
</html>

最佳答案

也许内容超出了容器,比如图片之类的。试试看是否是这种情况:

<html lang="en" class="practice">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <title>Practice Web</title>
    <meta name="description" content="practice">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type="text/css">
      body {
        width: 100%;
        overflow: hidden;
      }
    </style>
  </head>
  <body>
    <div id="app"></div>
    <script type="text/javascript" src="/bundle.js"></script>
  </body>
</html>

关于css - ReactJS + Heroku : Why doesn't my website become mobile responsive?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39476532/

相关文章:

javascript - 背景图片CSS不显示

javascript - 如何修复带有焦点和悬停的导航?

php - 将 HTML5 Canvas 数据保存到服务器

reactjs - 在 makeStyle 中使用 Prop 抛出错误属性 'height' 在类型 '{}' 上不存在

javascript - 使用 React 删除表中的项目后重新加载表

javascript - 当我在reactjs中使用jsop api时抛出 "unexpected token"错误?

javascript - 一些空间,即使 padding 和 margin 设置为 0px

php - css 转换在循环时不起作用

css - 淡出段落的最后一个字

javascript - 在html代码中从angularjs重复特定数量的div标签