美文网首页
less拼接字符串的方法

less拼接字符串的方法

作者: 可追 | 来源:发表于2017-10-16 21:40 被阅读0次

        在使用less时,有时候需要在样式内对变量和字串符直接量拼接,举个例子:

    .bg-image(@url) { background-image: url("@{url}/image1.png"); }

    .banner { background-repeat: no-repeat; .bg-image("banner"); }

    编译成css如下

    .banner {

    background-repeat: no-repeat;

    background-image: url("banner/image1.png");

    }

    相关文章

      网友评论

          本文标题:less拼接字符串的方法

          本文链接:https://www.haomeiwen.com/subject/irwluxtx.html