在ios上显示水平滚动条

时间:2022-12-05 21:17:21

I want to show a scroll bar at all times on ios devices. using this css below works vertically but not horizontally, anyone know how?

我想在ios设备上随时显示滚动条。下面使用这个css垂直但不是水平工作,任何人都知道如何?

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}
::-webkit-scrollbar-thumb {
    border-radius: 7px;
    background-color: #d6d6d6;
    -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
    display: block;
}

::-webkit-scrollbar-track {
    border-radius: 7px;
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.2); 
} 

2 个解决方案

#1


1  

Just needed to add height to ::-webkit-scrollbar

只需要为:: - webkit-scrollbar添加高度

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
    height: 7px;
}

#2


1  

Make sure you don't have overflow-scrolling set to touch.

确保没有设置触摸溢出滚动。

-webkit-overflow-scrolling: auto;

As far as i know you can't have momentum scrolling and a styled scrollbar

据我所知,你不能有动量滚动和风格滚动条

#1


1  

Just needed to add height to ::-webkit-scrollbar

只需要为:: - webkit-scrollbar添加高度

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
    height: 7px;
}

#2


1  

Make sure you don't have overflow-scrolling set to touch.

确保没有设置触摸溢出滚动。

-webkit-overflow-scrolling: auto;

As far as i know you can't have momentum scrolling and a styled scrollbar

据我所知,你不能有动量滚动和风格滚动条