border-radius属性具体详系介绍

1.border-radius可以同时设置1到4个值。

简洁法
    如果设置1个值,表示4个圆角都使用这个值。
    border-radius:40px;

    如果设置两个值,表示左上角和右下角使用第一个值,右上角和左下角使用第二个值。
    border-radius: 10px 50px;

    如果设置三个值,表示左上角使用第一个值,右上角和左下角使用第二个值,右下角使用第三个值。
    border-radius: 10px 50px 40px;

    如果设置四个值,则依次对应左上角、右上角、右下角、左下角(顺时针顺序)。
    border-radius: 10px 20px 30px 40px;

2.单独设置一个角的写法


border-top-left-radius: 20px; //设置左上角
border-top-right-radius: 20px; //设置右上角
border-bottom-left-radius: 20px; //设置左下角
border-bottom-right-radius: 20px; //设置左下角

 

3.CSS画实心圆(宽度和高度保持一致,并且设置border-radius:50%)

代码:

.circle{undefined
            width: 150px;/*宽高保持一致*/
            height: 150px;
            line-height: 150px; /*当高度与行高保持一致时为垂直居中*/
            border-radius: 50%;
            background: orange;
            margin: 50px;
            text-align: center;
            color: #fff;
        }

<div class="circle">圆形</div>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

结果才重要

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值