首页 > 解决方案 > X轴隐藏后不消失,在移动视图上仍然有效

问题描述

所以我最近一直在研究一个网站,并且遇到了一些小错误。其中一个确实是修复的问题,另一个我将在另一个论坛上讨论。

x 轴没有隐藏,即使隐藏在 CSS 中,这是一个真正的问题。它适用于笔记本电脑,但不适用于移动视图。

body {
    overflow-x: hidden;
     overflow-y: auto;
     max-width: 100%;
}

我的这个问题的网站地址是:

http://www.theeventlister.com/landingpage/events/uk/boardmasters.html

标签: htmlcssweb

解决方案


问题是以下代码:

     body, html {
     height: 100%;
     }

覆盖此代码:

    body {
     font-family: 'Roboto', sans-serif;
     position: fixed;
     font-weight: 400;
     font-size: 1.125rem;
     margin: 0;
     padding: 0;
     overflow-x: hidden;
     overflow-y: auto;
    }

只需添加溢出-x:隐藏;到第一个代码,它将起作用:

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

推荐阅读