css 样式 (圆角,阴影,边框)

1 盒子的圆角

<style>
.box {
        width: 100px;
        height: 100px;
        background-color: blue;
        border-radius: 10px;
    }
</style>

    <div class="box"></div>

 border-radius: 10px;    一个值时4个角都改变

  border-radius: 10px    30px;    2个值时 是对角改变(左上 右下)( 右上  左下 )

  border-radius: 10px    30px  20px;     三个值 上 (左上 右下) 下 

  border-radius: 10px    30px  20px 10px;    4个值是安瞬时针旋转 对应4个角

 border-radius:10px/40px; 是改变边框  

 

盒子阴影 

盒子阴影

c3是box-shadow来添加阴影

  box-shadow: 10px 10px 5px rgba(143, 132, 132, 0.5) inset;

来添加内阴影

外阴影是

  box-shadow: 10px 10px 5px rgba(143, 132, 132, 0.5) ;

 

 内外一起的是

   box-shadow: 10px 10px 5px rgba(143, 132, 132, 0.5) inset, 
7px 5px 5px rgba(159, 155, 155, 0.5);

 用图片做盒子的边框

border-image  要使用的元素

 .box2 {
        width: 220px;
        height: 100px;
        border: 15px solid transparent;
        border-image: url(img/border.png) 27 27 round;
    }

   border: 15px solid transparent;  不能为1px 背景图不能撑开 要设置合适的宽

round是平铺属性

 repeat  铺满

 .box3 {
        width: 220px;
        height: 100px;
        border: 15px solid transparent;
        border-image: url(img/border.png) 27 27 repeat;
    }
    

 repeat属性看是和第1个一样,在仔细看是会发现有的菱形是不完整的

 .box4 {
        width: 220px;
        height: 100px;
        border: 15px solid transparent;
        border-image: url(img/border.png) 27 27 stretch;
    }

 stretch是拉长 效果如下

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值