Search code examples
htmlcsswebadaptive-design

The site is displayed incorrectly on the mobile version


The crux of the problem is that when I go to my site via my phone, the mobile layout slips out, namely only a certain part is displayed, we can say that 2/3 of the site's width is displayed, so I have to move away so that the site is displayed correctly. And I need the site to be displayed in full, on the whole screen, and not some part. To see the problem, I recommend logging in from your phone. 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;
    }
}

If you need more code, please tell me.


Solution

  • Try write first line css style

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