如何强制滚动条出现在iPad中? (移动Safari) [英] How to force a scroll bar to appear in the ipad? (Mobile Safari)

查看:461
本文介绍了如何强制滚动条出现在iPad中? (移动Safari)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在移动版Safari中显示滚动条,因为当存在可滚动内容时,overflow:auto不起作用。我找到了这个css属性:

I am having trouble getting a scroll bar to appear in mobile safari because overflow: auto does not work when there is scroll-able content. I found this css property:

-webkit-overflow-scrolling:touch

-webkit-overflow-scrolling: touch

因为有些人认为这是一个修复移动safari隐藏滚动条但它不适合我。任何人都有任何关于如何强制在移动Safari中使用滚动条给用户提供他们应该滚动的视觉的建议吗?

as some suggested this is a fix for mobile safari hiding the scroll bars but it's not working for me. Anyone have any suggestions on how I can force there to be a scroll bar in mobile safari to give the user a visual that they are supposed to scroll?

推荐答案

在你的CSS中包括:

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

根据需要自定义外观。

Customize the appearance as needed.

Stackoverflow源

原始来源

这篇关于如何强制滚动条出现在iPad中? (移动Safari)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆