border的应用同心圆

<style>
		#one {
			width: 400px;
			height: 400px;
			border: 3px solid #000000;
			border-radius: 50%;
			float: left;
			margin: 0 auto;
			overflow: hidden;
		}

		.two {
			width: 350px;
			height: 350px;
			border: 3px solid #008000;
			border-radius: 50%;
			margin: 25px 0 0 25px;
		}

		.three {
			width: 300px;
			height: 300px;
			border: 3px solid #FF0000;
			border-radius: 50%;
			margin: 25px 0 0 25px;
		}

		.four {
			width: 250px;
			height: 250px;
			border: 3px solid #87CEEB;
			border-radius: 50%;
			margin: 25px 0 0 25px;
		}

		.five {
			width: 200px;
			height: 200px;
			border: 3px solid plum;
			border-radius: 50%;
			margin: 25px 0 0 25px;
		}

</style>

css样式

<div id="one">
			<div class="two">
				<div class="three">
					<div class="four">
						<div class="five">
						</div>
					</div>
				</div>
			</div>
		</div>

正文

 效果图

可以使用CSS3的动画来实现同心圆旋转动画。具体实现步骤如下: 1. 创建一个div容器,设置宽高和背景颜色,作为同心圆的容器。 2. 在容器中创建多个div元素,每个div元素的宽高和位置都不同,通过设置border-radius属性来实现同心圆的效果。 3. 使用CSS3的@keyframes规则定义旋转动画,设置transform: rotate()属性来实现旋转效果。 4. 将动画应用到容器上,使用animation属性来设置动画名称、持续时间、动画速度等参数。 以下是示例代码: HTML代码: ``` <div class="circle-container"> <div class="circle1"></div> <div class="circle2"></div> <div class="circle3"></div> <div class="circle4"></div> </div> ``` CSS代码: ``` .circle-container { width: 200px; height: 200px; background-color: #ccc; position: relative; } .circle1 { width: 50px; height: 50px; border-radius: 50%; position: absolute; top: 25px; left: 25px; } .circle2 { width: 100px; height: 100px; border-radius: 50%; position: absolute; top: 50px; left: 50px; } .circle3 { width: 150px; height: 150px; border-radius: 50%; position: absolute; top: 75px; left: 75px; } .circle4 { width: 200px; height: 200px; border-radius: 50%; position: absolute; top: 100px; left: 100px; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } .circle-container { animation-name: rotate; animation-duration: 2s; animation-timing-function: linear; animation-iteration-count: infinite; } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值