css 五环模型

方式一:

比较笨着,但可以基本实现,看个人需求进行修改。

(每个环分别进行定位)

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>hello</title>
		<link rel="stylesheet" type="text/css" href="css/55.css" />

	</head>
	<body>
		<div class="ring1"></div>
		<div class="ring2"></div>
		<div class="ring3"></div>
		<div class="ring4"></div>
		<div class="ring5"></div>
	</body>
	<!DOCTYPE html>
</html>
*{
	margin: 0;
	padding: 0;
}
div{
	width: 100px;
	height: 100px;
	border-radius: 50%;
	opacity: 0.5;
	left: 50%;
	top: 50%;
}
.ring1{
	position: fixed;
    margin-left: -50px;
	margin-top: -85px;
	z-index: 3;
	border: 2px solid black;
}
.ring2{
	position: fixed;
	margin-left: -130px;
	margin-top: -85px;
	border: 2px solid red;
}
.ring3{
	position: fixed;
	margin-left: 30px;
	margin-top: -85px;
	border: 2px solid blue;
}
.ring4{
	position: fixed;
	margin-left: -10px;
	margin-top: -15px;
	border: 2px solid green;
}
.ring5{
	position: fixed;
	margin-left: -90px;
	margin-top: -15px;
	border: 2px solid yellow;
}

改进方式二:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>五环</title>
		<link rel="stylesheet" type="text/css" href="./1.css"/>
	</head>
	<body>
		<div class="plat">
			<div class="ring1"></div>
			<div class="ring2"></div>
			<div class="ring3"></div>
			<div class="ring4"></div>
			<div class="ring5"></div>

		</div>
	</body>
</html>
*{
	margin: 0px;
	padding: 0px;
}

.ring1,
.ring2,
.ring3,
.ring4,
.ring5{
	position: absolute;
	width: 100px;
	height: 100px;
	border-radius: 50%;
	border: black 10px solid;	
	
}
.ring2{
	z-index: 3;
	left: 130px;
	border: red 10px solid;	
}
.ring3{
	
	left: 260px;
	border: yellow 10px solid;	
}
.ring4{
	
	left: 65px;
	top: 60px;
	border: green 10px solid;
}
.ring5{
	
	left: 195px;
	top: 60px;
	border: blue 10px solid;
}
.plat{
    text-align: center;
	line-height: 180px;
	position: absolute;
	margin-top:-90px ;
	margin-left:-190px ;
	left:50% ;
	top: 50%;
	width: 380px;
	height: 180px;
}

 

效果:

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值