如何隐藏div中的滚动条

时间:2017-01-14 14:06:21

标签: html css

我创建了一个div,它包含了可滚动的溢出内容,但是我希望它的滚动被隐藏但是div仍然是可滚动的。

.description
{
    height: 150px;
    overflow: scroll;
}

<div class="description">
    <h4>Description</h4>
    <p>After a series of deadly discoveries, Bruce Wayne has learned that the Court of Owls is real � and a deadly threat out to control Gotham City! Unleashing their deadly assassins known as the Talons, Batman must stop the insidious Court of Owls before they claim the city for their own. In doing so, The Dark Knight will uncover dark secrets � not just about the city he�s sworn to protect, but about the history of the Wayne family.After a series of deadly discoveries, Bruce Wayne has learned that the Court of Owls is real � and a deadly threat out to control Gotham City! Unleashing their deadly assassins known as the Talons, Batman must stop the insidious Court of Owls before they claim the city for their own. In doing so, The Dark Knight will uncover dark secrets � not just about the city he�s sworn to protect, but about the history of the Wayne family.After a series of deadly discoveries, Bruce Wayne has learned that the Court of Owls is real � and a deadly threat out to control Gotham City! Unleashing their deadly assassins known as the Talons, Batman must stop the insidious Court of Owls before they claim the city for their own. In doing so, The Dark Knight will uncover dark secrets � not just about the city he�s sworn to protect, but about the history of the Wayne family.</p>
</div>

1 个答案:

答案 0 :(得分:11)

您可以通过对其应用display:none来隐藏滚动条。请尝试以下css。

CSS:

::-webkit-scrollbar { 
    display: none; 
}

JSFiddle:https://jsfiddle.net/nikdtu/arn77mt1/