css-(border-image)

用图片做边框效果

  • border-image-source:url();

  • border-image-slice:数字; 还有个fill属性用来填充

  • border-image-repeat:round | stretch repeat ;

  • border-image-width:xx px;

    round.jpg

    #mydiv{
    width: 200px;
    height: 100px;
    border: 4px solid red; /这个照样写/
    border-image-source: url(border.png);
    border-image-slice:9; /这个数字多少效果就会有不一样的/
    border-image-repeat:round;
    border-image-width: 5px;

      }
    
stretch.jpg
      #mybtn{
    width: 200px;
    height: 100px;
    /*border: 5px solid red;*/ /*这个可以没有的*/
    border-image-source:url(button1.png);
    border-image-slice: 23; /*好像这个越大切的越细,不能有px*/
    border-image-repeat:stretch;
    border-image-width: 20px;
}
button.jpg
 #mybtn2{
    width: 400px;
    height: 100px;
    border-image-source: url(button2.png);
    border-image-slice: 23 fill; /*填充整个div*/
    border-image-repeat: round;
    /*border-image-width: 20px;*/ /*这个没有用*/
    text-align: center;
    font-family: "微软雅黑";
    font-size: 47px;
    color:white;
    line-height:100px;
    text-shadow:6px 6px 6px #000;  /*都忘记了还有text-shadow,就记得box-shadow*/
}
#mybtn2:hover{
    text-shadow: -6px -6px 6px #666;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值