css - 移动端网站宽度发生变化

标签 css sass materialize

您好,我的网站宽度在移动设备上无法正常显示,所以网站看起来太小了。正常的宽度应该是375,但变成了980。我不知道为什么?因为我只使用 materialize 而我的 SCSS 没有硬编码任何宽度。我没有任何开始的线索。希望得到一些帮助。谢谢。

My website A sample website

    .brand-logo {
  margin: 0 10px 0 10px;
}

.YellowtailLogo {
    font-family: 'Yellowtail', cursive;
}
.brand-logo img{
    height: 28px;
    position: relative;
    margin-right: 10px;
    top: 3px;
}

.h1Landing {
    font-family: 'Yellowtail', cursive;
    color: #ee6e73;
}

.msg_page_container {
    height: 100%;
    position: fixed;
    width: 100%;
    overflow: hidden;
    left: 0px;
    padding: 0 10% 0 10%;

    .collection {
      overflow: scroll;
      height: 40%;
    }

    .msg_input_div{

    }
}

最佳答案

使用媒体查询将内容宽度更改为手机屏幕的宽度:

@media screen and(max-width:375px){
html,body{width:100%;
box-sizing:border-box;
}
}

并包含

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

在 CSS 中

关于css - 移动端网站宽度发生变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41906944/

相关文章:

php - 无法使用 php 实例调用图像

html - 如何在 float div 中垂直和水平居中定位元素?

html - 文本溢出 : ellipsis alignment issue

javascript - 实现导航栏问题

javascript - 没有滚动条的水平滚动标签

javascript - 在 javascript 循环中设置多个 Div 的样式

css - 有什么方法可以在SASS函数中使用CSS变量吗?

sass - SASS 中 LESS 的 "import (reference) ' 样式'"相当于什么

css - Gulp sourcemaps 和 sass 问题

javascript - 使用带箭头的 MaterializeCSS 轮播 - 如何使用普通 javascript 进行初始化