bootstrap 图片横向滚动条_Bootstrap 4水平滚动条div

I got this working for Bootstrap 3 but the same code won't work in Bootstrap 4.

Basically, I'm trying to create a horizontal scroll for DIV and here's a working JSFIDDLE for Bootstrap 3 (which I don't want): DEMO

The same code for Bootstrap 4 isn't working though! Here's the JSFiddle for Bootstrap 4: https://jsfiddle.net/6kvw2q5h/

HTML

1
1
1
1
1
1
1

CSS

.live__scroll {

overflow-x: auto;

overflow-y: hidden;

white-space: nowrap;

}

.live__scroll .live__scroll--box {

display: inline-block;

float: none;

padding: 15px;

border: 1px solid red;

}

What am I doing wrong? I'm at wits end.

解决方案

HTML

1
2
3
4
5
6
7
8
9

CSS

/* The heart of the matter */

.testimonial-group > .row {

overflow-x: auto;

white-space: nowrap;

}

.testimonial-group > .row > .col-sm-4 {

display: inline-block;

float: none;

}

/* Decorations */

.col-sm-4 { color: #fff; font-size: 48px; padding-bottom: 20px; padding-top: 18px; }

.col-sm-4:nth-child(3n+1) { background: #c69; }

.col-sm-4:nth-child(3n+2) { background: #9c6; }

.col-sm-4:nth-child(3n+3) { background: #69c; }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值