利润率最高的负面问题

Margin top negatif issue

当我想水平滚动块时遇到问题,当我使用平板或在屏幕上滚动时,我想删除一个移动,它是块容器移动上的垂直移动,此移动是由于块幻灯片上的边距顶部负数 您可以在这个示例和模式 IPHONE X/XS/11 PRO 中看到 enter link description here

如何删除它?

更改溢出-x:滚动到溢出-x:隐藏;

#container-mobile {
    width: 100vh;
    height: 100vw;
    transform: rotate(-90deg) translateX(-100vh);
    transform-origin: top left;
    overflow-x: hidden;
    margin-top: 100px !important;
    /* pour ie et mozilla */
    -ms-overlow-style: none;
    scrollbar-width: none;
}

请注意,滚动行为是旋转的,因为您可能旋转了元素。

更新

要解决滚动反转的问题,你应该这样替换 CSS 类:

.slide {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 100px;
    margin-top: -250px !important;
}

.blocHorizontal {
    display: flex;
    flex-direction: row;
    width: 400vw;    
}

#container-mobile {
    width: 100%;
    height: 100%;
    overflow-y: hidden;
    margin-top: 100px !important;
    /* pour ie et mozilla */
    -ms-overlow-style: none;
    scrollbar-width: none;
}