html div x,html - Scroll x with div - Stack Overflow

From what your code is explaining to me above it looks like each slide of your slider is going to be an image. If so, I recommend altering your slider to the following code below:

CODE SNIPPET:

.slider {

width: 100%;

max-width: 960px;

overflow: hidden;

}

.slider figure img {

width: 25%;

float: left;

height: auto;

}

.slider figure {

width: 400%;

position: relative;

margin: 0;

padding: 0;

animation: 10s slide infinite;

-webkit-animation: 10s slide infinite;

}

@-webkit-keyframes slide {

0% {

left: 0%;

}

16% {

left: 0%;

}

33% {

left: -100%;

}

49% {

left: -100%;

}

66% {

left: -200%;

}

82% {

left: -200%;

}

100% {

left: -300%;

}

}

604ac686d7151507ea9aceed8bf18915.png

268553776dd48bc6a010eec732e465b4.png

3025b7f5971e232aea6d1fb60a7e70e9.png

franklin-richards.jpg

Rather than having a specific DIV each time to call your img class, we can instead just use the actual img tag. Along with that, in this method I've used the keyframes css to control the slide images positioning.

Should you really want to control this with div content, you could simply wrap the images in your div and alter the class .slider figure img to .slider figure divto include other types of content.

I hope that this helps you in your endeavours.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值