簡體   English   中英

為什么移動網站的右側有過多的空白?

[英]Why does mobile site have excessive white space to the right?

有一個移動版本的網站,在 iPhone 的右側有過多的空間。 該網站是 www.liveinhomecare.com

之前已經修復了使用 overflow: hidden; 工作的問題。 但不再工作了。

有人知道解決這個問題的方法嗎?

順便說一句,我有可能導致這種情況的文本的全寬橫幅,但使用上述修復程序糾正了這一點,但現在又回來了......

.banner h1 {
    clear: both;
    font-weight: 400;
    margin: 0;
    text-rendering: optimizeLegibility;
    text-transform: uppercase !important; 
    color: #ebebeb !important;

    font-size: 12px !important; 
    font-size: 0.75rem !important; 
    line-height: 1.25;
    margin-top: 0.250em;
    margin-bottom: 0em;
}
.banner h2{
    margin-top: 0.750em !important; 
    color: #ffffff !important;
}

.banner {
    position: relative; /* for child pseudo-element */
    z-index: 0;
    margin: 0 -600rem;
    /* add back negative margin value */
    padding: 0.25rem 600rem;
    background: #3887b7;
    color: #ffffff !important;
    padding-top: 50px;
    padding-bottom: 30px;
    margin-bottom: 40px;

    overflow: hidden;
}
.banner:before {
    content: "";
    position: absolute;
    z-index: -1; /* behind parent */
    top: 0;
    bottom: 0;
    /* subtract h2 padding (1.5rem) */
    left: 598.5rem;
    right: 598.5rem;
    background: #3887b7;

    overflow: hidden;
}

只需添加溢出-x:隱藏; 到您的 HTML 元素:

    html {
      height: 100%;
      overflow-x: hidden;
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM