html - 如何仅在需要时显示 Bootstrap 3 弹出窗口滚动

标签 html css twitter-bootstrap scroll popover

我有这个弹出窗口,带有滚动条

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/

相关文章:

html - 不需要的断线行为 - 一般说明

html - overflow hidden 时在 Webkit/mozilla 中滚动

javascript - 在 highcharts 的 Y 轴上显示带下划线的标签文本

css - Chrome 和 Safari 上 LI 元素周围的额外填充

javascript - HTML slider 不会隐藏

javascript - 仅从段落文本中隐藏字母

css - 使用过滤器在ie9中定位背景图像

javascript - 修复了 IE 11 和 Microsoft Edge 中表格的标题

jquery - 如何让所有标签在左侧对齐?

css - Bootstrap 导航栏将社交图标折叠在彼此之上