CSS边框

博客介绍了CSS边框的相关知识。包括边框基本属性,如border - style常见值有实线、虚线、点状线,且该属性必须设置才有边框;还提到四个方向可独立设置及简写形式,以及border - radius。最后进行实战,如制作圆、半圆、1/4圆和椭圆。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

边框的基本属性

border-style常见的值有:solid实线,dashed虚线,dotted点状线。
在这里插入图片描述
注意:这三个值中border-style是必须的,如果只设置其他两个值不会显示边框。但只要设置了border-style,就会有边框,例如设置border: solid;chrome中width是0.6px,color等于字体颜色,默认是黑色。
在这里插入图片描述

TRBL与简写

四个方向可以独立设置,并具有简写形式

在这里插入图片描述

border-radius

在这里插入图片描述随便写个看看效果

div{
    width: 100px;
    height: 100px;
    border:  solid;
    border-radius: 30px / 10px;
}

在这里插入图片描述

实战

div{
   width: 100px;
   height: 100px;
   border:  solid;
   border-radius: 50%;
}

在这里插入图片描述
半圆

div{
     width: 100px;
     height: 50px;
     border:  solid;
     border-radius: 50px 50px 0 0;
 }

在这里插入图片描述
1/4圆

div{
   width: 100px;
     height: 100px;
     border:  solid;
     border-radius: 100px 0 0 0;
 }

在这里插入图片描述
椭圆

div{
    width: 100px;
    height: 50px;
    border:  solid;
    border-radius: 100px / 50px;
}

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值