body标签中是不是用不了渐变?
需要在body中设置width和height。
或者需要在body中直接添加背景图片。
==是一个纯css版本的太阳系=
<style type="text/css">
body{
margin: 0;
padding: 0;
height: 800px;
width: 1500px;
/*bodyz*/
background: radial-gradient(ellipse at center , #1C2837 0%, #050608 100%);
}
.word{
width: 300px;
position: absolute;
top: 30px;
left: 30px;
color: #f1f1f1;
z-index: 9999;
}
.word .h1{
font-size: 45px;
letter-spacing: 10px;
line-height: 65px;
}
.word p{
width: 260px;
line-height: 25px;
}
.ball1{
width: 60px;
height: 60px;
box-shadow: 0px 0px 20px #FFD306;
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
margin: -30px 0 0 -30px;
background:radial-gradient(ellipse at center, #ffd000 1%,#f9b700 39%,#f9b700 39%,#e06317 100%);
/*background: linear-gradient(120deg,#FFD306,#ff5151);*/
}
.ball2{
width: 15px;
height: 15px;
border-radius: 50%;
position: absolute;
left: 10px;
top: 10px;
background-color: #ccff80;
}
.ball3{
width: 10px;
height: 10px;
border-radius: 50%;
position: absolute;
background-color: #003d79;
left:20px;
top: 30px;
}
.ball4{
width: 24px;
height: 24px;
border-radius: 50%;
position: absolute;
background-color:#977c00;
left: 500px;
top: 60px;
}
.ball5{
width: 32px;
height: 32px;
border-radius: 50%;
position: absolute;
background-color:#e1e100;
left: 370px;
top: 70px;
}
.ball6{
width: 22px;
height: 22px;
border-radius: 50%;
position: absolute;
background-color:#ff2d2d;
left: 700px;
top: 170px;
}
.circle1{
width: 90px;
height: 90px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 100px;
position: absolute;
left: 50%;
top: 50%;
margin: -45px 0 0 -45px;
}
.circle2{
width: 140px;
height: 140px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 100px;
position: absolute;
left: 50%;
top: 50%;
margin: -70px 0 0 -70px;
animation: circle 45s infinite;
}
@keyframes circle{
0%{transform: rotate(0deg);}
100%{transform: rotate(-360deg);}
}
.circle3{
width: 200px;
height: 200px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 100px;
position: absolute;
left: 50%;
top: 50%;
margin: -100px 0 0 -100px;
animation: circle3 40s infinite;
}
@keyframes circle3{
0%{transform: rotate(0deg);}
100%{transform: rotate(-360deg);}
}
.circle4{
width: 280px;
height: 280px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
margin: -140px 0 0 -140px;
}
.circle5{
width: 560px;
height: 560px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
margin: -280px 0 0 -240px;
}
.circle6{
width: 720px;
height: 720px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
margin: -360px 0 0 -320px;
}
.circle7{
width:880px;
height: 880px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
margin: -440px 0 0 -400px;
}
.circle8{
width:1100px;
height: 1100px;
border: 1px solid rgba(102, 166, 229, 0.12);
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
margin: -650px 0 0 -500px;
}
</style>
SOLAR SYSTEM
I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,
<P>I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,I know this is the one that you like,</P>
</div>
<div class="ball1"></div>
<div class="ball3"></div>
<div class="ball4"></div>
<div class="ball5"></div>
<div class="ball6"></div>
<div class="circle1"></div>
<div class="circle2">
<div class="ball2"></div>
</div>
<div class="circle3">
<div class="ball3"></div>
</div>
<div class="circle4"></div>
<div class="circle5"></div>
<div class="circle6"></div>
<div class="circle7"></div>
<div class="circle8"></div>