如果文本从 div 溢出但仍然能够滚动,如何隐藏滚动

How to hide the scroll if text if it overflows from a div but still be able to scroll

我查看了其他类似的 Whosebug 问题,但我仍然无法弄清楚。如何隐藏滚动条,但如果需要,我仍然可以在那个特定的 div 上滚动。 它不会全局隐藏滚动条,只是针对特定的 div。

    .test {
        position: absolute;
        height: 25px;
        width: 100px;
        padding: 0px;
        margin: 0px;
        top: 10px;
        left: 10px;
        word-wrap: break-word;
        font-family: arial;
        font-size: 10px;
        font-weight: 400;
        color: red;
        line-height: 10px;
        white-space: nowrap;
        overflow: hidden;
        overflow-x: scroll;
        overflow-y: scroll;
    }
<div class="test">
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<div>

.test{
    position: absolute;
        height: 25px;
        width: 100px;
        padding: 0px;
        margin: 0px;
        top: 10px;
        left: 10px;
        word-wrap: break-word;
        font-family: arial;
        font-size: 10px;
        font-weight: 400;
        color: red;
        line-height: 10px;
        white-space: nowrap;
        overflow: hidden;
}

.inner{
    overflow: auto;
    padding-bottom: 30px;
}
<div class="test">
    <div class="inner">
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    </div>
<div>

如果你将内容包装在另一个 div 中,它基本上隐藏了溢出中的滚动条,它应该可以正常工作