gpt4 book ai didi

html - 我想更改水平滚动条 css

转载 作者:行者123 更新时间:2023-11-28 19:31:15 24 4
gpt4 key购买 nike

我想更改水平滚动条的 CSS。这里我用代码来改变它,但它也改变了我的垂直滚动条,我只想改变水平滚动条。怎么做?这里我也上传图片。

::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}

enter image description here

最佳答案

试试这个

div {
width: 400px;
overflow-x: auto;
white-space: nowrap;
}

div::-webkit-scrollbar {
width: 1em;
}

div::-webkit-scrollbar-track {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

div::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color: #00bd86;
outline: 2px solid slategrey;
}

div::-webkit-scrollbar:vertical {
display: none;
}
<div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
survived not only five centuries, but also the leap into</div>

关于html - 我想更改水平滚动条 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54996023/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com