sass中代码使用

1、sass中background:url问题,避免写一个又一个url链接,css.sass

// $img:"../image"; //本地路径
$img:"https://XXX/image";//服务器路径
//使用
.box{
    background:url('#{$img}/btn.png') no-repeat;
    background-size: 100%;
}

2、less中background:url问题 css.less

@img:"../image"
.box{
    background:url("@{img}/bg.png") no-repeat;
    background-size:100%;
}

  

 

posted @ 2020-07-14 18:51  蓝精灵61  阅读(198)  评论(0编辑  收藏  举报