10.(初级)CSS边框border

一、边框

边框四边同时设置:

border:1px(宽度) solid(样式) #ddd(颜色);

各边边框分别设置:

border-top/border-left/border-right/border-bottom

边框样式

 

三、边框圆角

border-radius:1px(左上) 1px(右上) 1px(左下) 1px(右下);

1、边框画圆形:

元素为正方形,border-radius:50%

例如:

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

 

2、边框画椭圆:

元素为长方形,border-radius:50%(横向半径)/50%(纵向半径)

例如:

div{
    width: 100px;height: 50px;
    border:4px solid #999;
    border-radius: 50%/50%;
}

 

3、边框画两侧圆:

元素为长方形,border-radius:3px(不大于border宽度)/50%(纵向半径)

例如:

div{
    width: 100px;height: 50px;
    border:4px solid #999;
    border-radius: 3px/50%;
}

 

三、边框阴影

box-shadow:

(inset) 1px(X轴偏移值) 1px(Y轴偏移值)  1px(投影半径) (阴影尺寸) 颜色;

说明:

inset:表示向内投影,不设置即默认向外投影。

投影半径:模糊度和宽度,值越大越模糊,宽度越大。

阴影尺寸:阴影扩展量,扩展量之外才开始模糊。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值