CSS圆形

1) 如何通过CSS画带有阴影的实心圆

div{

width: 50px;
height: 50px;
background-color: yellow;
border-radius: 25px; 
box-shadow: 5px 5px 5px #888888; 

}


2) 空心圆border值尽可能小,不设置背景颜色。
div{
width: 50px;
height: 50px;
border: 1px blue solid;
border-radius: 25px;

}


3) 虚线圆
div{
width: 50px;
height: 50px;
border: 1px blue dashed;
border-radius: 25px;

}


4) 四分之一圆:宽高设置一样,border-radius设置和宽高一样大小,并且只设置一个半径。
div{
width: 50px;
height: 50px;
background-color: blue;
border-radius: 50px 0 0 0;

}


       

5) 半圆:高度设置为宽度的一半,border-radius设置为宽高的一半,并且只设置两个半径


6)月亮
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>月亮</title>
	<style>
		.test{
			background-color: black;
			width: 120px;
			height: 120px;
		}
		.cir1{
            width: 100px;
            height: 100px;
            border-radius: 50px;
            background-color: white;
            float: left;
            position: relative;
		}
		.cir2{
            width: 96px;
            height: 96px;
            border-radius: 48px;
            background-color: black;
            float: left;
            position: absolute;
            margin-left: 20px;
		}
	</style>
</head>
<body>
	<div class="test">
		<div class="cir1"></div>
		<div class="cir2"></div>
	</div>
</body>
</html>


       
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值