iphone - iphone 中的 CSS3 自定义滚动问题

标签 iphone css scrollbar

我已经为 webkit 浏览器定制了滚动条。 以下是它的代码。

#defaultScroll p {
    width: 600px
}
#defaultScroll {
    height: 400px;
    width: 300px;
    overflow-x: scroll;
    position: relative;
}
#defaultScroll::-webkit-scrollbar-button {
    background: blue;
}
#defaultScroll::-webkit-scrollbar {
    width: 12px;
}
#defaultScroll::-webkit-scrollbar-track {
    background-color: #ffff00;
    border: 1px solid red;
}
#defaultScroll::-webkit-scrollbar-thumb {
    background-color: red;
    border-radius: 5px;
}
#defaultScroll::-webkit-scrollbar-thumb:hover {
    background-color: green;
}

这是demo为了它。

它在所有浏览器中都工作正常,但是只有在 iphone 中 overflow-x 是不可见的。

enter image description here

最佳答案

刚刚为 #defaultScroll::-webkit-scrollbar 添加了 height: 12px

#defaultScroll::-webkit-scrollbar {
    width: 12px;
    height: 12px
   }

一切都很好。

我开始知道我们需要为水平滚动条定义高度。

关于iphone - iphone 中的 CSS3 自定义滚动问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23082231/

相关文章:

iphone - Apple 推送通知服务 - 发送许多通知

html - 如何翻转div标签内的文字?

wpf - XAML Canvas 上可放大和缩小的滚动条

出现 CSS 溢出滚动条但不工作

jquery - 在调整屏幕大小之前,滚动条不会加载或调整大小

iphone - UISlider的editingDidEnd事件在iPad上不起作用

iphone - 自定义 UITableViewCell 中的自定义 UIView

iphone - 通过 SQLIte 数据库访问对象

javascript - 生成随机位置后如何设置随机颜色(比如说绿色)

css - 这个 CSS 属性中的负值是什么?