【问题标题】:The site is displayed incorrectly on the mobile version网站在手机版上显示不正确
【发布时间】:2022-01-10 13:51:19
【问题描述】:

问题的症结在于,当我通过手机访问我的网站时,手机版面滑出,即只显示了某个部分,可以说是显示了网站宽度的2/3,所以我必须移开才能正确显示该站点。而且我需要在整个屏幕上完整显示该站点,而不是某个部分。 要查看问题,我建议从您的手机登录。 My site

@media all and (max-width: 479px) {
.container {
    max-width: 479px;
}

.header {
    background-image: url('/img/header-767.png');
    padding: 10px 0px 10px;
    &-section {
        margin: 0 auto;
    }
    &-item {
        display: none;
        &-2 {
            display: none;
        }
    }
    &-logo {
        font-size: 12px;
    }
    span {
        display: none;
    }
}

.banner {
    margin: -1px 0;
    background-image: url(/img/Banner-479.svg);
    &-text {
        padding-top: 35px;
        padding-bottom: 55px;
        padding-left: 110px;
        font-size: 20px;
    }
}

.product {
    margin-top: -20px;
    &-text {
        font-size: 36px;
    }
    .product-item {
        margin: 15px 90px 0px;
    }

    .product-list {
        display: table-caption;
        margin-right: 0px;
        margin-bottom: 30px;
    }
}

.portfolio {
    margin-left: 105px;
    margin-right: 114px;
    .portfolio-title {
        font-size: 36px;
        margin-top: -20px;
  }
    .portfolio-items {
        grid-template: repeat(8, 1fr) / repeat(1, 1fr);
        gap: 15px;
  }
}

.order {
    background-image: url('/img/Order-479.svg');
    margin-top: 15px;
    padding-bottom: 90px;
    h1 {
        font-size: 36px;
    }
    h3 {
        margin-top: 15px;
        margin-left: 10px;
        margin-right: 182px;
        font-size: 10px;
    }   
}

.buy {
  background-image: url('/img/buy-479.svg');
  margin-top: 15px;
  padding-bottom: 150px;
    h1 {
        font-size: 36px;
    }
    h3 {
        font-size: 10px;
        margin-top: 15px;
        margin-left: 10px;
    }
}

.about { 
    background-image: url('/img/about-479.svg');
    background-position: 0px 45px;
    margin-top: 15px;
    padding-bottom: 30px;
    h1 {
        font-size: 36px;
    }
    h3 {
        font-size: 10px;
        margin-top: 15px;
        margin-left: 210px;
    }
}

如果您需要更多代码,请告诉我。

【问题讨论】:

    标签: html css web adaptive-design


    【解决方案1】:

    尝试编写第一行 css 样式

    {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-13
      • 2012-01-07
      • 1970-01-01
      • 2013-09-18
      • 1970-01-01
      • 2018-06-28
      • 1970-01-01
      • 2011-04-22
      相关资源
      最近更新 更多