本教程操作环境:Windows10系统、CSS3版、DELL G3电脑
css3怎么实现围绕圆心公转?
CSS3动画 表情包围绕圆公转而不自转
效果如图
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>公转不自转</title>
<style>
.out {
margin-top: 200px;
margin-left: 200px;
position: relative;
height: 300px;
width: 300px;
border-radius: 150px;
background-color: sandybrown;
box-shadow: 0 0 23px;
}
.cover {
display: inline-block;
width: 50px;
height: 50px;
position: absolute;
transform-origin: 150px 150px;
animation: smile linear 5s infinite;
background-color: springgreen;
}
img {
width: 50px;
height: 50px;
animation: smile reverse linear 5s infinite;
}
@keyframes smile {
to {
transform: rotateZ(360deg);
}
}
.out span {
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
}
</style>
</head>
<body>
<div>
<div>
<img
src="https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1577100031&di=7445f215ef1f860d45fd93be22b52f57&src=http://git.oschina.net/uploads/group/110103951448978.jpg"
alt="">
</div>
<span>和蔼的笑脸</span>
</div>
</body>
</html>
以上就是css3怎么实现围绕圆心公转的详细内容,更多请关注编程网其它相关文章!