“每个人心里都要有一道彩虹”,请完成如下“彩虹”效果。
效果图:
任务要求:
用最少两种方式完成“彩虹”
彩虹颜色可自定义
提示:
可以使用渐变来完成
每条彩虹颜色可以使用边框来完成
每条彩虹颜色,可以用两个元素重叠在一起来完成
效果中多余的部分,可以设置超出隐藏
登录后即可发布作业,立即登录
我的作业
全部作业 128
在这里输入代码
<!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>
<style>
* {
margin: 0;
padding: 0;
}
.father {
width: 400px;
height: 400px;
margin: 40px auto;
/* border: 1px solid red; */
position: relative;
}
.father .color1 {
width: 380px;
height: 380px;
border-radius: 50%;
border: 10px solid purple;
}
.father .color2 {
width: 360px;
height: 360px;
border-radius: 50%;
border: 10px solid skyblue;
position: absolute;
top: 50%;
margin-top: -190px;
left: 50%;
margin-left: -190px;
}
.father .color3 {
width: 340px;
height: 340px;
border-radius: 50%;
border: 10px solid cyan;
position: absolute;
top: 50%;
margin-top: -180px;
left: 50%;
margin-left: -180px;
}
.father .color4 {
width: 320px;
height: 320px;
border-radius: 50%;
border: 10px solid green;
position: absolute;
top: 50%;
margin-top: -170px;
left: 50%;
margin-left: -170px;
}
.father .color5 {
width: 300px;
height: 300px;
border-radius: 50%;
border: 10px solid yellow;
position: absolute;
top: 50%;
margin-top: -160px;
left: 50%;
margin-left: -160px;
}
.father .color6 {
width: 280px;
height: 280px;
border-radius: 50%;
border: 10px solid orange;
position: absolute;
top: 50%;
margin-top: -150px;
left: 50%;
margin-left: -150px;
}
.father .color7 {
width: 260px;
height: 260px;
border-radius: 50%;
border: 10px solid red;
position: absolute;
top: 50%;
margin-top: -140px;
left: 50%;
margin-left: -140px;
}
.father .mask {
width: 400px;
height: 200px;
position: absolute;
bottom: 0;
left: 0;
background-color: #fff;
}
</style>
</head>
<body>
<div class="father">
<div class="color1"></div>
<div class="color2"></div>
<div class="color3"></div>
<div class="color4"></div>
<div class="color5"></div>
<div class="color6"></div>
<div class="color7"></div>
<div class="mask"></div>
</div>
</body>
</html>