麻烦老师查看作业,谢谢

来源:2-28 项目作业

派大星爱学习

2022-04-26 17:14:13

<!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>

/* 彩虹颜色使用边框来完成 */

div.box2,

.box3,

.box4,

.box5,

.box6,

.box7 {

border-radius: 50%;

}


div.box1 {

overflow: hidden;

margin: 60px auto;

width: 440px;

height: 200px;

}


div.box2 {

margin: 0 auto;

width: 400px;

height: 400px;

border: 20px solid red;

}


div.box3 {

width: 360px;

height: 360px;

border: 20px solid orange;

}


div.box4 {

width: 320px;

height: 320px;

border: 20px solid yellow;

}


div.box5 {

width: 280px;

height: 280px;

border: 20px solid green;

}


div.box6 {

width: 240px;

height: 240px;

border: 20px solid blue;

}


div.box7 {

width: 200px;

height: 200px;

border: 20px solid blueviolet;

}


/* 彩虹颜色使用元素重叠来完成 */

div.cur2,

.cur3,

.cur4,

.cur5,

.cur6,

.cur7,

.cur8 {

border-radius: 50%;

padding: 20px;

}


.cur1 {

width: 440px;

height: 200px;

margin: 60px auto;

overflow: hidden;

}


.cur2 {

width: 400px;

height: 400px;

background-color: red;

}


.cur3 {

width: 360px;

height: 360px;

background-color: orange;

}


.cur4 {

width: 320px;

height: 320px;

background-color: yellow;

}


.cur5 {

width: 280px;

height: 280px;

background-color: green;

}


.cur6 {

width: 240px;

height: 240px;

background-color: blue;

}


.cur7 {

width: 200px;

height: 200px;

background-color: blueviolet;

}


.cur8 {

width: 160px;

height: 160px;

background-color: white;

}


/* 使用渐变来完成 */

div.rainbow {

width: 460px;

height: 200px;

margin: 0 auto;

overflow: hidden;

}


div.content {

width: 460px;

height: 460px;

border-radius: 50%;

background-image: radial-gradient(50% 50%, white 30%, blueviolet 30%, blueviolet 40%, blue 40%, blue 50%, green 50%, green 60%, yellow 60%, yellow 70%, orange 70%, orange 80%, red 80%, red 90%, white 90%, white 100%);

}

</style>

</head>


<body>

<!-- 彩虹颜色使用边框来完成 -->

<div class="box1">

<div class="box2">

<div class="box3">

<div class="box4">

<div class="box5">

<div class="box6">

<div class="box7"></div>

</div>

</div>

</div>

</div>

</div>

</div>


<!-- 彩虹颜色使用元素重叠来完成 -->

<div class="cur1">

<div class="cur2">

<div class="cur3">

<div class="cur4">

<div class="cur5">

<div class="cur6">

<div class="cur7">

<div class="cur8"></div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>


<!-- 使用渐变来完成 -->

<div class="rainbow">

<div class="content"></div>

</div>

</body>


</html>


写回答

1回答

好帮手慕星星

2022-04-26

同学你好,三种方式实现效果很棒。继续加油,祝学习愉快!

0

0 学习 · 17877 问题

查看课程