简体   繁体   English

为什么在移动设备中网站右侧有一个空白区域

[英]Why There is A White space on right side of website in Mobile devices

Why is there an empty white space on the right side of my mobile website display?为什么我的移动网站显示右侧有一个空白区域? like this my error screeenshot here and this is my live link像这样我的错误截图在这里,这是我的 实时链接

I beg for your help and thank you :)我请求你的帮助,谢谢你:)

its your .bottom-cloud in the top-container what causes the issue.它是顶部容器中的 .bottom-cloud 导致问题的原因。

<img class="bottom-cloud" src="img/awan.png" alt="">

it has a position:absolute with position out of the viewport which causes the viewport expanding.它有一个位置:绝对,位置在视口之外,导致视口扩展。

Add an overflow:hidden to the top-container and it wont expand it.添加一个溢出:隐藏到顶部容器,它不会扩展它。

You have issue in awan.png image.您在awan.png图像中有问题。 This image is absolute position for Mobile and Desktop.此图像是移动和桌面的absolute位置。 In smaller screen this image showing in outside of .top-container .在较小的屏幕中,此图像显示在.top-container You have two option to fix this issue.您有两种选择来解决此问题。

Option 1选项1

Using @media for mobile devices.在移动设备上使用@media You no need to use this cloud image for mobile devices.您无需将此云映像用于移动设备。

@media (max-width: 767px){
    .bottom-cloud{
        display: none;
    }
}

Option 2选项 2

Make top-container class overflow hidden.隐藏top-container类溢出。

.top-container{
    position: relative;
    padding-top: 100px;
    background-color: var(--biru-muda);
    overflow: hidden;
}

Hope this help!.希望这有帮助!。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM