css3的border-radius

border语法

border-radius支持是四个角,总共八个值(水平+垂直)的设置:

border-radius:1px 2px 3px 4px / 5px 6px 7px 8px;

表示

border-top-left-radius:1px 5px;
border-top-right-radius:2px 6px;
border-bottom-right-radius:3px 7px;
border-bottom-left-radius:4px 8px;

表示从左上角开始,顺时针旋转依次设置每个角的水平值和垂直值

有以下几种简写方式

border-radius:50%;
/*等同于*/
border-radius:50% 50% 50% 50%/50% 50% 50% 50%;
border-radius:50% 20%;
/*等同于*/
border-radius:50% 20% 50% 20%;
border-radius:50% 20% 40%;
/*等同于*/
border-radius:50% 20% 40% 20%;

举几个例子

1、制作一个椭圆

.circle{
    width:150px;
    height:100px;
    border-radius:50%;
    border:1px solid red;
}

椭圆

2、半椭圆

.circle{
    width:150px;
    height:100px;
    border-radius:50% 50% 0 0/100% 100% 0 0;
    border:1px solid red;
}

半椭圆

.circle{
			width:150px;
		    height:100px;
		    border-radius:100% 0 0 100%/50% 0 0 50%;
		    border:1px solid red;
}

半椭圆

3、一片树叶

.circle{
    width:150px;
    height:100px;
    border-radius:100% 0;
    border:1px solid red;
}

树叶

4、普通的图形

.circle{
    width:150px;
    height:100px;
    border-radius:10px 20px 30px 40px/20px 30px 40px 50px;
    border:1px solid red;
}

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值