圆角border-radius

一、语法

1、分开写

border-top-left-radius:左上;
border-top-right-radius:右上;
border-bottom-right-radius:右下;
border-bottom-left-radius:左下;

2、合并写

(1)四个参数

 border-radius:左上 右上 右下 左下;

(2)三个参数

border-radius:左上  右上左下  右下;

(3)两个参数

border-radius:左上右下  右上左下;

(4)1个参数

border-radius:四个角一样;

二、实例

1、一个圆角(右上

(1)样式

 #abc{
	 	width: 400px;
	 	height: 400px;;
	 	background-color: red;
 		margin-top:100px;
 		border-top-right-radius:2em; 
	 }

(2)元素

 <div id="abc"></div>

(3)效果

2、两个圆角(左上、右上

(1)样式

#fillet{
	 	width:300px;
	 	height: 400px;
	 	background-color: green;
	 	border-top-left-radius:2em;
		border-top-right-radius:2em;
		border-bottom-right-radius:0em;
		border-bottom-left-radius:0em; 
	}

(2)元素

<div id="fillet"></div>

(3)效果

3、三个圆角(左上、右上、右下

(1)样式

 #ef{
	 	width: 400px;
	 	height: 400px;;
	 	background-color: black;
 		margin-top:100px;
 		border-top-left-radius:2em;
		border-top-right-radius:2em;
		border-bottom-right-radius:2em;
	 }

(2)元素

<div id="ef"></div>

(3)效果

4、四个圆角

(1)样式

 #gh{
	 	width: 400px;
	 	height: 400px;;
	 	background-color: pink;
 		margin-top:100px;
 		border-radius:2em;
	 }

(2)元素

<div id="gh"></div>

(3)效果

5、不同比例圆角(2种:左上、右下10px ;左下、右上100px)

(1)样式

#son{
	 	width: 400px;
	 	height: 400px;;
	 	background-color: blue;
 		margin-top:100px;
 	 	border-radius:10px  100px;
 }

(2)元素

<div id="son"></div>

(3)效果

6、不同比例圆角(3种:左上20px;右上、左下50px ;右下100px)

(1)样式

 #gh{
	 	width: 400px;
	 	height: 400px;;
	 	background-color: #9400D3;
 		margin-top:100px;
 		border-radius:20px 50px 100px;
	}

(2)元素

<div id="gh"></div>

(3)效果

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值