我有这个弹出窗口,带有滚动条
HTML
<ul class="navbar-nav pull-right">
<li><a href="#" data-toggle="popover" title="Notifications" data-html="true" data-content="<a href='?Profile'><div class='pop-text'>Notification 1</div></a><hr /><a href='?Profile'><div class='pop-text'>Notification 2</div></a><hr /><a href='?Profile'><div class='pop-text'>Notification 3</div></a><hr /><a href='?Profile'><div class='pop-text'>Notification 4</div></a><hr /><div><p id='foot-notification-pop'><a href='?notification'>Show all</a></p></div>">Notification</a></li>
</ul>
CSS
.popover-body {
height: 200px;
overflow-y: auto;
}
我只想在需要时显示滚动条,即仅当弹出内容的高度超过 200px 的高度时。当时滚动条一直显示,但是当高度小于200px时(当然)不能点击。 我该怎么做? 任何帮助将不胜感激。谢谢!
最佳答案
您可以使用 overflow:auto
。阅读更多关于 overflow property 的信息这里
关于html - 如何仅在需要时显示 Bootstrap 3 弹出窗口滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21456772/