CSS-溢出:滚动;-总是显示垂直滚动条?

CSS-溢出:滚动;-总是显示垂直滚动条?,第1张

CSS-溢出滚动;-总是显示垂直滚动条?

我自己就遇到了这个问题。OSx Lion在不使用时会隐藏滚动条,使它看起来更“光滑”,但是同时出现了您解决的问题:人们有时看不到div是否具有滚动功能。

解决方法:在您的CSS中包括-

::-webkit-scrollbar {  -webkit-appearance: none;  width: 7px;}::-webkit-scrollbar-thumb {  border-radius: 4px;  background-color: rgba(0, 0, 0, .5);  box-shadow: 0 0 1px rgba(255, 255, 255, .5);}::-webkit-scrollbar {  -webkit-appearance: none;  width: 7px;}::-webkit-scrollbar-thumb {  border-radius: 4px;  background-color: rgba(0, 0, 0, .5);  box-shadow: 0 0 1px rgba(255, 255, 255, .5);}#container {  height: 4em;    overflow-y: scroll;  }#child {  height: 12em;  }#container {  background-color: #ffc;}#child {  margin: 30px;  background-color: #eee;  text-align: center;}<div id="container">  <div id="child">Example</div></div>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5037470.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-15
下一篇 2022-11-15

发表评论

登录后才能评论

评论列表(0条)

保存