Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何停止页面上的所有垂直滚动?_Html_Css - Fatal编程技术网

Html 如何停止页面上的所有垂直滚动?

Html 如何停止页面上的所有垂直滚动?,html,css,Html,Css,我想我的网站只允许侧面滚动(因为它是一个侧面滚动网站)。目前在手机上,你可以无休止地垂直滚动。这是怎么回事/ 这是我的HTML: <body> <div id="first" class="panel"> <img class="brand" src="assets/images/RF_Logo.png"> </div> <div id="newsletter" class="panel"> ... </div

我想我的网站只允许侧面滚动(因为它是一个侧面滚动网站)。目前在手机上,你可以无休止地垂直滚动。这是怎么回事/

这是我的HTML:

<body> 
    <div id="first" class="panel"> <img class="brand" src="assets/images/RF_Logo.png"> </div> 
    <div id="newsletter" class="panel"> ... </div> 
    <div id="directions" class="panel"> ... </div> 
    <div id="contact" class="panel"> ... </div> </div> 
</body> 

在CSS中将隐藏的溢出也添加到正文中:

身体{
overflow-y:隐藏;

}

在CSS中将隐藏的溢出也添加到正文中:

身体{
overflow-y:隐藏;

}

作为起点,您需要
高度:100%
溢出-y:隐藏用于
正文
html
(也不是
最小高度
)。

作为起点,您需要
高度:100%
溢出-y:隐藏
用于
body
html
(也不是
minheight
)。

尝试将此添加到标记中的可能副本:对我来说很好。你是在mac上做这件事的吗?@Trevor Clarke不太适合移动设备displays@Ashwin不,一台装有谷歌F12模式的Windows10电脑可能与尝试将此添加到您的标签中的相同:对我来说很好。你是在mac上做这件事的吗?@Trevor Clarke不太适合移动设备displays@Ashwin不,是带谷歌F12模式的Windows 10电脑
*{
    padding:0;
    margin:0;
    font-family: 'Josefin Sans', sans-serif;
}
html{
        overflow-y: hidden;
}
body{
    background-color: #1A1A1E;
    min-height: 100vh;
}

.brand{
    width: 300px;
    padding: 10px;
}

#first{
    height: 100vh;
}