标签:八卦图 50% height width color background border css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>八卦图</title>
<style>
.container {
width: 401px;
height: 401px;
border-radius: 50%;
box-sizing: border-box;
border: 1px solid #000;
display: flex;
overflow: hidden;
animation: rotating 4s linear infinite;
}
@keyframes rotating {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* 白色背景那部分样式 */
.white-wrap {
width: 50%;
height: 100%;
background-color: #fff;
position: relative;
}
.black-circle {
width: 100%;
height: 50%;
border-radius: 50%;
background-color: #000;
position: absolute;
bottom: 0;
right: -50%;
}
.mini-white-circle {
width: 30%;
height: 30%;
border-radius: 50%;
background-color: #fff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9;
}
/* 黑色背景那部分样式 */
.black-wrap {
width: 50%;
height: 100%;
background-color: #000;
position: relative;
}
.white-circle {
width: 100%;
height: 50%;
border-radius: 50%;
background-color: #fff;
position: absolute;
top: 0;
left: -50%;
}
.mini-black-circle {
width: 30%;
height: 30%;
border-radius: 50%;
background-color: #000;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9;
}
</style>
</head>
<body>
<div class="container">
<div class="white-wrap">
<div class="black-circle">
<div class="mini-white-circle"></div>
</div>
</div>
<div class="black-wrap">
<div class="white-circle">
<div class="mini-black-circle"></div>
</div>
</div>
</div>
</body>
</html>
标签:八卦图,50%,height,width,color,background,border,css 来源: https://blog.csdn.net/c2635222586/article/details/113827769
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。