<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="index.css">
<script src="index.js"></script>
</head>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
body {
width: 100%;
position: relative;
}
.hidden-box {
height: 200px;
width: 300px;
overflow: hidden;
}
ul {
height: 600px;
list-style: none;
animation:moveUl 12s infinite;
transition: all 0.5s;
}
ul li{
height: 200px;
}
li:first-child {
background: red;
}
li:nth-child(2) {
background: blue;
}
li:last-child {
background: yellow;
}
@keyframes moveUl {
0%,30%{
transform: translateY(0);
}
33%,60%{
transform: translateY(-200px);
}
66%,100%{
transform: translateY(-400px);
}
}
.flex-box {
height: 200px;
width: 100%;
padding-left: 200px;
margin-top: 20px;
box-sizing: border-box;
}
.flex-child-box1 {
height: 100%;
width: 200px;
background: blue;
float: left;
margin-left: -200px;
}
.flex-child-box2 {
height: 100%;
background: yellow;
}
.flex-child-box3 {
width: 200px;
background: brown;
flex-grow: 0;
flex-shrink: 0;
}
.flex2-box {
height: 200px;
width: 100%;
display: flex;
margin-top: 20px;
}
.flex2-child-box1 {
width: 200px;
height:100%;
background: blue;
flex-shrink: 0;
flex-basis: 200px;
}
.flex2-child-box2 {
width: 100%;
background: yellow;
}
.flex3-box {
height: 200px;
width: 100%;
margin-top: 20px;
}
.flex3-child-box1 {
width: 200px;
float: left;
height: 100%;
background: blue;
}
.flex3-child-box2 {
height: 100%;
background: yellow;
overflow: hidden;
}
</style>
<body>
<div class="flex-box">
<div class="flex-child-box1"></div>
<div class="flex-child-box2"></div>
</div>
<div class="flex2-box">
<div class="flex2-child-box1"></div>
<div class="flex2-child-box2"></div>
</div>
<div class="flex3-box">
<div class="flex3-child-box1"></div>
<div class="flex3-child-box2"></div>
</div>
</body>
</html>