如何设置文本区域上滚动条样式的格式?
我确信这应该不像看起来那么困难...我不能使用 JQuery 滚动窗格,因为我需要它在提交时充当标准表单文本区域..需要在 IE7+、Safari 和 IE7+ 中工作;至少 Firefox...有什么想法吗?
试过这个...
textarea {
scrollbar-face-color: #ff8c00;
scrollbar-track-color: #fff8dc;
scrollbar-arrow-color: #ffffff;
scrollbar-highlight-color: #fff8dc;
scrollbar-shadow-color: #d2691e;
scrollbar-3dlight-color: #ffebcd;
scrollbar-darkshadow-color: #8b0000;
}
...但只适用于 IE ?
有什么想法吗?
I'm sure this shouldn't be as difficult as it seems... I can't use a JQuery scrollpane because I need it to act as a standard form textarea when it gets submitted.. needs to work in IE7+, Safari & firefox at least... any ideas?
Tried this...
textarea {
scrollbar-face-color: #ff8c00;
scrollbar-track-color: #fff8dc;
scrollbar-arrow-color: #ffffff;
scrollbar-highlight-color: #fff8dc;
scrollbar-shadow-color: #d2691e;
scrollbar-3dlight-color: #ffebcd;
scrollbar-darkshadow-color: #8b0000;
}
... but only works in IE ?
Any ideas??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
-webkit-scrollbar
伪元素作为滚动条:您可以在此处找到更多详细信息:https://css-tricks.com/almanac/properties/s/scrollbar/
Use
-webkit-scrollbar
pseudo-elements for scroll bar:You can find more detail here: https://css-tricks.com/almanac/properties/s/scrollbar/
我从来没有这样做过,所以我对此并不完全确定,但我记得我的一位同事正在为我们正在开发的一个网站这样做,他也遇到了同样的小问题。
我认为你走在正确的轨道上,尽管滚动条属性需要位于主体CSS中,如下所示:
也许你可以尝试提供所需的文本区域和id属性并将其应用到CSS中,所以:
I have never done this so im not completely sure on this, but I remember one my colleagues was doing this for a site we were developing and he had the same minor issue.
I think you are along the right track, although the scrollbar properties need to be in the body css like so:
Maybe you could try giving the desired text area and id property and apply that in the css, so: