css - 滚动条未显示到导航选项卡内容 Bootstrap

标签 css twitter-bootstrap

我有右侧栏,它用导航选项卡表示,我想显示滚动条到选项卡内容但它没有显示我想将动态数据加载到第一个导航选项卡但由于滚动条没有显示我无法滚动。

.right-sidebar-wrapper #r-s-tab{
  overflow-y: auto;
  height: 100%;
  position:fixed;
}
.right-sidebar-wrapper #activity a, .right-sidebar-wrapper #locations a{  
  padding-top: 8px;
  border-radius: 3px;
  display: block;
}
#activity a img, #locations a img {
  height: 120px;
  width: 100%;
}
<div class="right-sidebar-wrapper">
    <div id="r-s-tab" class="tab-content">
        <div class="tab-pane fade active in" id="activity">
            <div class="col-lg-12">
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
                <a href="#">
                    <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
                </a>
            </div>
        </div>
    </div>
    <div class="tab-pane fade" id="locations">
        <div class="col-lg-12">
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
            <a href="#">
                <img src="http://placehold.it/350x150" class="img-responsive img-rounded">
            </a>
        </div>
    </div>
<div>

最佳答案

你试试这个....

.right-sidebar-wrapper{
  height: 100%;
}
.right-sidebar-wrapper #r-s-tab{
  position:fixed;
}
.right-sidebar-wrapper #r-s-tab{
  height: 200px; // Set this height to the appropriate size
  overflow-y: scroll; // Only add scroll to vertical column
}

关于css - 滚动条未显示到导航选项卡内容 Bootstrap ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40946053/

相关文章:

javascript - 如何在html中隐藏所需的输入弹出窗口

javascript - Bootstrap 模态力滚动到顶部

javascript - 弹出窗口中的表格不起作用

javascript - 动态地使网页垂直适合浏览器

php - 如果满足条件,则在 php 时调用 Bootstrap 模式

jquery - Fuelux 向导验证输入

javascript - Twitter Bootstrap——将导航栏搜索设置为 100% 宽度

html - 使用 Bootstrap 时垂直选项卡的布局问题

css - 如何让一个div填充屏幕高度的剩余部分

CSS Flexbox,从右到左的内容,右对齐,底部对齐