码迷,mamicode.com
首页 > 其他好文 > 详细

太极图----伪类实现

时间:2017-01-24 16:10:17      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:key   style   div   char   pre   white   title   position   play   

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>太极</title>
<style>
*{
margin:0;
padding:0;
}
div, :before, :after {
box-sizing: border-box;
}
#taiji {
position: absolute;
top: 50%;
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>

太极图----伪类实现

标签:key   style   div   char   pre   white   title   position   play   

原文地址:http://www.cnblogs.com/qiancheng123/p/6347150.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!