-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css] 第390天 使用css写一个红绿灯交替的动画效果 #2352
Comments
<title>Document</title>
<style>
.box{
margin: 0 auto;
width: 80px;
border-radius: 40px;
border: 3px solid #333;
background-color: #333;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
}
.light{
width: 50px;
height: 50px;
border-radius: 50%;
margin: 10px 0;
background: #000;
opacity: .1;
}
.red{
background: #ff0000;
animation: 12s red infinite;
}
.yellow{
background: #ffff00;
animation: 12s yellow infinite;
}
.green{
background: #31da38;
animation: 12s green infinite;
}
@Keyframes red{
0%{opacity: 1;}
30%{opacity: 1;}
33%{opacity: .1;}
}
@Keyframes yellow{
0%{opacity: .1;}
33%{opacity: .1;}
36%{opacity: 1;}
63%{opacity: 1;}
66%{opacity: .1;}
}
@Keyframes green{
0%{opacity: .1;}
66%{opacity: .1;}
69%{opacity: 1;}
97%{opacity: 1;}
100%{opacity: .1;}
}
</style>
|
<!DOCTYPE html> |
第390天 使用css写一个红绿灯交替的动画效果
我也要出题
The text was updated successfully, but these errors were encountered: