CSS导航按钮滚动不适用于移动设备

时间:2018-12-12 17:55:26

标签: html css

手机上的CSS导航菜单按钮出现问题。内容无法在移动设备/触摸屏上滚动,但需要滚动,因为多个链接会导致内容太长。有什么帮助吗?

.dropbtn {
  border: #3eab37 solid 2px;
  color: white;
  /*padding: 16px;
  font-size: 16px;
  border: none;*/
  font-family: 'Roboto',sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  padding: 20px 25px;
  font-size: 1.3vw;
  cursor: pointer;
  border-radius: 4px;
  background: transparent;
  transition: all 0.4s ease;
}
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  height: auto;
  max-height: 165px;
  overflow-y: scroll;
  white-space: nowrap; /* [1] */
  overflow-x: auto; /* [2] */
  -webkit-overflow-scrolling: touch; /* [3] */
  -ms-overflow-style: -ms-autohiding-scrollbar;
  display: none;
  position: absolute;
  background-color: #f1f1f1;
  min-width: 254px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}
.dropdown-content a {
  color: #3eab37;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 1.2vw;
  padding: 16px;
  text-decoration: none;
  display: block;
}

https://jsfiddle.net/g0tapbdk/2/

谢谢!

0 个答案:

没有答案