欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

边框-绘制八卦图

程序员文章站 2022-03-11 09:37:04
...

效果

边框-绘制八卦图

代码

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.box {
			position: relative;
			width: 400px;
			height: 400px;
			border: 1px solid #000;
			margin: 100px auto;
			background-color: #eee;
		}
		.left {
			float: left;
			width: 200px;
			height: 400px;
			background-color: rgb(255, 255, 255);
			border-radius: 200px 0 0 200px;
		}
		.right {
			float: left;
			width: 200px;
			height: 400px;
			background-color: rgb(0, 0, 0);
			border-radius: 0 200px 200px 0;
		}
		.top {
			position: absolute;
			left: 100px;
			top: 0;
			width: 200px;
			height: 200px;
			box-sizing: border-box;
			border-radius: 50%;
			border: 70px solid #000;
			background-color: #fff;
		}
		.bottom {
			position: absolute;
			left: 100px;
			bottom: 0;
			width: 200px;
			height: 200px;
			box-sizing: border-box;
			border: 70px solid #fff;
			background-color: #000;
			border-radius: 50%;
		}
	</style>
</head>
<body>
	<div class="box">
		<div class="left"></div>
		<div class="right"></div>
		<div class="top"></div>
		<div class="bottom"></div>
	</div>
</body>
</html>