HTML旋转的太极图
2018-01-17 11:06
288 查看
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="">
<title>旋转的太极图</title>
<style>
body{
margin: 0px;
background-color: #ccc;
}
html,body{
height: 100%;
}
@keyframes ani{
100%{
transform: rotate(360deg);
}
}
.content{
position: fixed;
height: 400px;
width: 400px;
border-radius: 50%;
overflow: hidden;
background-color: white;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
animation: ani 2s linear infinite;
}
.circle{
height: 400px;
width: 200px;
}
.circle::before{
content: "";
position: absolute;
height: 200px;
width: 200px;
border-radius: 50%;
overflow: hidden;
left: 0;
right: 0;
margin: auto;
}
.circle::after{
content: "";
position: absolute;
height: 50px;
width: 50px;
border-radius: 50%;
overflow: hidden;
left: 0;
right: 0;
margin: auto;
z-index: 2;
}
.lf{
float: left;
background-color: black;
}
.lf::before{
top: 0;
background-color: black;
}
.lf::after{
top: 50px;
background-color: white;
}
.rgt{
float: right;
background-color: white;
}
.rgt::before{
bottom: 0;
background-color: white;
}
.rgt::after{
bottom: 50px;
background-color: black;
}
</style>
</head>
<body>
<div class="content">
<div class="lf circle"></div>
<div class="rgt circle"></div>
</div>
</body>
</html>
效果图如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="">
<title>旋转的太极图</title>
<style>
body{
margin: 0px;
background-color: #ccc;
}
html,body{
height: 100%;
}
@keyframes ani{
100%{
transform: rotate(360deg);
}
}
.content{
position: fixed;
height: 400px;
width: 400px;
border-radius: 50%;
overflow: hidden;
background-color: white;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
animation: ani 2s linear infinite;
}
.circle{
height: 400px;
width: 200px;
}
.circle::before{
content: "";
position: absolute;
height: 200px;
width: 200px;
border-radius: 50%;
overflow: hidden;
left: 0;
right: 0;
margin: auto;
}
.circle::after{
content: "";
position: absolute;
height: 50px;
width: 50px;
border-radius: 50%;
overflow: hidden;
left: 0;
right: 0;
margin: auto;
z-index: 2;
}
.lf{
float: left;
background-color: black;
}
.lf::before{
top: 0;
background-color: black;
}
.lf::after{
top: 50px;
background-color: white;
}
.rgt{
float: right;
background-color: white;
}
.rgt::before{
bottom: 0;
background-color: white;
}
.rgt::after{
bottom: 50px;
background-color: black;
}
</style>
</head>
<body>
<div class="content">
<div class="lf circle"></div>
<div class="rgt circle"></div>
</div>
</body>
</html>
效果图如下:
相关文章推荐
- HTML 5:绘制旋转的太极图
- HTML 5:绘制旋转的太极图
- HTML 5:绘制旋转的太极图
- html旋转动画
- 无聊做了个旋转太极图
- 旋转太极 css+cavans文章
- css3实现太极旋转
- JAVA 按任意角度旋转图片,并生成新的旋转后图片(转自:http://www.hackchina.com/r/21265/RotateImage.java__html)
- HTML5+CSS3旋转风车
- iOS下html上传图片被旋转问题
- css---border-radius--实现太极图旋转
- 旋转太极八卦
- 旋转的太极
- Demo13:div实现太极旋转
- html 绘制太极
- HTML5+css3圆形指针旋转进度条、css3动态进度条
- Java实现的一个旋转效果(旋转太极)
- 旋转的太极图
- 自定义View-太极旋转
- html 按钮旋转