用html和css 来做奥运五环
一、实现效果


二:部分代码描述
没啥好讲的,注意2点吧!一个 transition-delay: 0.1s; 过渡效果开始前等待时间的设置和对奥运五环的设置即可。
.ao{
width: 250px;
height: 250px;
border-radius:50%; /*设置圆角*/
border: 10px solid ;
transform: 0.1;
}
.blue{
float: left;
border-color: blue;
}
.black{
float: left;
margin-left: 30px;
border-color: black;
transition-delay: 0.1s;
}
三:代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body{
margin: 0;
padding: 0;
background: url(images/中国.png);
background-size: 100% 100%;
overflow: scroll;
}
.box{
width: 1000px;
height: 500px;
margin: 100px auto;
}
.ao{
width: 250px;
height: 250px;
border-radius:50%; /*设置圆角*/
border: 10px solid ;
transform: 0.1;
}
.blue{
float: left;
border-color: blue;
}
.black{
float: left;
margin-left: 30px;
border-color: black;
transition-delay: 0.1s;
}
.red{
float: left;
margin-left: 30px;
border-color: red;
transition-delay: 0.2s;
}
.yellow{
float: left;
margin-left: 140px;
margin-top: -70px;
border-color: yellow;
transition-delay: 0.3s;
}
.green{
float: left;
margin-left: 40px;
margin-top: -70px;
border-color: green;
transition-delay: 0.4s;
}
.box:hover .ao{
box-shadow: 0 0 50px 30px yellow; /*X轴偏移量、Y轴偏移量、模糊半径、扩散半径和颜色。*/
transform: scale(1.1);
}
</style>
<body>
<div class="box">
<div class="ao blue"></div>
<div class="ao black"></div>
<div class="ao red"></div>
<div class="ao yellow"></div>
<div class="ao green"></div>
</div>
</body>
</html>
四:总结
不值一哂,加油!
955

被折叠的 条评论
为什么被折叠?



