这段代码在其他浏览器上工作正常,但在Safari浏览器上右侧间距不对称。我知道这个属性在Safari上不支持,正在寻找解决方案。
.card {
background: red;
padding: 24px 12px 24px 24px;
width: 240px;
margin: 0 auto;
height: 160px;
}
.scrollable-content {
scrollbar-gutter: stable;
overflow-y: auto;
scrollbar-width: thin;
}
.scrollable-content::-webkit-scrollbar {
width: 12px;
background-color: blue;
}
.scrollable-content::-webkit-scrollbar-track {
border-radius: 8px;
}
.scrollable-content::-webkit-scrollbar-thumb {
background-clip: content-box;
background-color: rgba(136, 136, 136, 0.5);
border: 4px solid transparent;
border-radius: 8px;
height: 56px;
}
.scrollable-content::-webkit-scrollbar-thumb:hover {
background-color: #888888;
}
.card-body {
background-color: yellow;
}
<div class="card scrollable-content">
<div class="card-body">
test lorem100
</div>
</div>
如何在Safari上实现