Smooth Infinite Scrolling Banner [CSS Only]

ⅰ亾dé卋堺 提交于 2019-12-01 06:54:13

Check this out: https://jsfiddle.net/sergdenisov/wb28eeh2/3/.

You had unnecessary space between images (cause display: inline, read this article — https://css-tricks.com/fighting-the-space-between-inline-block-elements/). I set:

.photobanner, .photobanner2 {
    font-size: 0
}

Then I remove padding-right: 2px and set:

.photobanner img, .photobanner2 img {
    margin-right: 5px;
}

Really space between 2 img tags was 6px, now it's 5px.

Now we can calculate required margin-left for animation: 6 x (350 + 5) = 2130px. That's it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!