我希望我的网站只允许侧滚动(因为它是一个侧滚动网站)。目前在移动设备上,您可以无限地垂直滚动。这是怎么回事?
这是我的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:
*{
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;
}
答案 0 :(得分:0)
在CSS中添加隐藏到主体的溢出:
body {
private IEnumerator Killninja() {
yield return new WaitForSeconds (4f);
Destroy (gameObject);
}
void Update () {
StartCoroutine (Killninja ());
}
}
答案 1 :(得分:0)
作为起点,height: 100%
和overflow-y: hidden;
(不 body
)需要html
和min-height
。