css图片无缝自动滚动

.roll {
    width: 100%;
    min-width: 46.875rem;
    height: 300px;
    margin-top: 100px;
    overflow: hidden;
    margin: 50px auto;
}

.ulBox {
    position: relative;
    top: 0px;
    left: 0px;
    width: 200%;
    height: 100%;
    list-style: none;
    animation: mymove 5s infinite linear;
}

.ulBox img {
    width: 100%;
    height: 100%;
}

.ulBox li {
    width: 98px;
    height: 98px;
    float: left;
    vertical-align: middle;
    text-align: center;
    line-height: 98px;
    color: white;
    font-weight: 600;
}

@-webkit-keyframes mymove {
    from {
        left: 0px;
    }

    to {
        left: -500px;
    }
}
1 <div class="roll">
2                 <ul class="ulBox">
3                     <li v-for="(roll,index) in roll" :key="index">
4                         <img :src="roll.img">
5                     </li>
6                 </ul>
7             </div>
View Code

直接放源码,不整图片磨磨唧唧,li最好放两个

posted @ 2021-12-08 15:44  文采呱呱  阅读(229)  评论(0编辑  收藏  举报