108CSS3 Effect: Taiji FIG.

Method One: three div achieved. Ideas: (1) by the outer circular div gradation of black and white content is divided into two upper and lower regions; (2) with two circular div color content of the intermediate layer to change the color of the region; (3) an inner layer with two circular div to restore the color of the color content of the region. Place the cursor on the map Tai Chi, Tai Chi map will rotate! 
** css Code **

`` `CSS: RUN
<! DOCTYPE HTML>
<HTML>
<head>
<Meta charset =" UTF-. 8 ">
<title> Taiji </ title>
<class style =" CP-PEN- Styles ">
* {
padding: 0;
margin: 0;
}
.outer {
background: Linear-gradient (to bottom, White 50%, Black 50%);
margin: Auto 100px;
width: 200px;
height: 200px;
border- RADIUS: 50%;
position: relative;
border:
transition: all 5s ease;
}
.outer:hover{
transform: rotate(360deg) scale(1.5);
}
.outer .left{
background: white;
width:100px;
height:100px;
border-radius: 50%;
position:absolute;
left: 0;
top:50px;
}
.outer .left .leftInner{
background: black;
width:40px;
height:40px;
border-radius: 50%;
position:absolute;
left: 30px;
top:30px;
}
.outer .right{
background: black;
width:100px;
height:100px;
border-radius: 50%;
position:absolute;
right: 0;
top:50px;
}
.outer .right .rightInner{
background: white;
width:40px;
height:40px;
border-radius: 50%;
position:absolute;
left:30px;
top:30px;
}
</style>
</head>
<body>
<div class="outer">
<div class="left">
<div class="leftInner"></div>
</div>
<div class = "right">
<div class = "rightInner"> </ div>
</ div>
</ div>
</ body>
</ HTML>
`` `


Method two: pseudo-class implementation. Ideas: (1) by the outer circular gradation Among div into upper and lower two regions; (2) adding a dummy class, pseudo-circular border color class to change the color of the region; (3) round by pseudo-class color restoration shaped color content of the region. Place the cursor on the map Tai Chi, Tai Chi map will rotate!
** html Code **

: `` `HTML RUN
<! DOCTYPE HTML>
<HTML>
<head>
<Meta charset =" UTF-. 8 ">
<title> Taiji </ title>
<style>
* {
margin: 0;
padding: 0;
}
div,: before,: After {
Box-Sizing: border-Box;




left: 50%;
width: 200px;
height: 200px;
margin: -100px 0 0 -100px;
background: linear-gradient(0deg, black 50%, white 50%);
border-radius: 50%;
border:1px black solid;
}
@keyframes taiji {
from{
transform: rotate(0deg) scale(1);
}
to{
transform: rotate(360deg) scale(2);
}
}
#taiji:hover {
animation: taiji 1s ease 0s infinite;
}
#taiji:before, #taiji:after {
content: "";
display: block;
position: absolute;
width: 50%;
height: 50%;
top: 25%;
border-radius: 50%;
border: 35px solid transparent;
}
#taiji:before {
left: 0;
border-color: black;
background-color: white;
}
#taiji:after {
right: 0;
border-color: white;
background-color: black;
}
</style>
</head>
<body>
<div id="taiji"></div>
</body>
</html>
```

Guess you like

Origin www.cnblogs.com/gushixianqiancheng/p/10967257.html