简单八卦图的实现
程序员文章站
2022-05-30 08:29:16
...
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>八卦图</title>
<style>
.box{
height: 300px;
width: 400px;
background: rgba(51,102,205,0.8);
margin: 100px auto;
position: relative;
}
.box1{
height: 200px;
width: 200px;
background: black;
border-radius: 50%;
position: absolute;
border: 5px solid rgba(255,255,254,0.8);
left: 50%;
top: 50%;
transform:translate(-50%,-50%);
display: none;
}
.box1_1{
height: 100px;
width: 200px;
border-radius: 100px 100px 0 0;
background: white;
/*border: 1px solid;*/
}
.box1_2{
height: 100px;
width: 100px;
background: white;
position: absolute;
right: 0;
top: 50px;
border-radius: 50%;
/*border: 1px solid;*/
}
.box1_3{
height: 100px;
width: 100px;
background: black;
position: absolute;
left: 0;
top: 50px;
border-radius: 50%;
}
.box2{
height: 50px;
width: 50px;
background: black;
position: absolute;
right: 0;
top: 50%;
transform:translate(-50%,-50%);
border-radius: 50%;
}
.box3{
height: 50px;
width: 50px;
background: white;
position: absolute;
/*left: 0;
top: 0;*/
transform:translate(50%,50%);
border-radius: 50%;
}
</style>
</head>
<body>
<div class="box">
<div class="box1">
<div class="box1_1"></div>
<div class="box1_2">
<div class="box2"></div>
</div>
<div class="box1_3">
<div class="box3"></div>
</div>
</div>
</div>
<script src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(function(){
$(".box1").show(2000);
})
</script>
</body>
</html>