转动的太极纯HTML代码
程序员文章站
2024-03-19 09:08:04
...
Web基础篇
HTML-03转动的太极图
<style>
.box{
width:400px;
height:400px;
background-color:gray;
margin:100px auto 0 auto;
border-radius:50%;
position:relative;
animation:rotate 3s linear infinite;
}
@keyframes rotate{
0%{
transform:rotate(0deg);
}100%{
transform:rotate(360deg);
}
}
.square{
width:200px;
height:400px;
position:absolute;
top:0;
}
.squareWhite{
background-color:white;
left:0;
border-radius:200px 0 0 200px;
}
.squareBlack{
background-color:black;
right:0;
border-radius:0 200px 200px 0;
}
.circle{
width:200px;
height:200px;
border-radius:50%;
position:absolute;
left:100px;
}
.circleWhite{
background-color:white;
top:0;
}
.circleBlack{
background-color:black;
bottom:0;
}
.dot{
width:30px;
height:30px;
background-color:black;
border-radius:50%;
position:absolute;
top:85px;
left:85px;
}
.dotWhite{
background-color:white; /*后定义的样式会把先定义的覆盖*/
}
</style>
</head>
<body>
<div class="box">
<!-- 一个标签可以定义多个类名 -->
<div class="square squareWhite"></div>
<div class="square squareBlack"></div>
<div class="circle circleWhite">
<div class="dot"></div>
</div>
<div class="circle circleBlack">
<div class="dot dotWhite"></div>
</div>
</div>
</body>
</html>
上一篇: [洛谷P3952] 时间复杂度
下一篇: 记一次惨痛的安装软件经历
推荐阅读
-
转动的太极纯HTML代码
-
facebook,twitter,pinterest的分享功能代码--js+html
-
js 获取元素的html代码
-
Android原生代码(Java)与HTML(JS)的交互
-
Sublime Text插件的离线安装-使用htmlprettify美化您的HTML代码 Sublime TexthtmlJavaScriptprettify
-
php正则删除html代码中class样式属性的方法 原创
-
PHP正则删除html代码中a标签并保留标签内容的方法 原创
-
PHP正则删除HTML代码中宽高样式的方法
-
Java发送带html标签内容的邮件实例代码
-
php实现页面纯静态的实例代码