一、css
<style>
div,
body {
margin: 0;
padding: 0;
}
.box {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
position: absolute;
overflow: hidden;
height: 175px;
width: 100vw;
}
.box .list {
transition: 0.3s all;
display: flex;
position: absolute;
left: -375px;
height: 175px;
}
.box .list>div:nth-child(2n-1) {
background-color: rgb(7, 231, 104);
}
.box .list>div:nth-child(2n) {
background-color: pink;
}
.box .list div {
text-align: center;
line-height: 200px;
width: 100vw;
height: 175px;
text-align: center;
font-size: 50px;
}
</styl