background: url(${@http}/img/icon/daorug@2x.png
) no-repeat center 3rem / auto 25%;
@http是一个变量
这样书写会不现实,也没有解析!
请问该怎么办?
background: url(${@http}/img/icon/daorug@2x.png
) no-repeat center 3rem / auto 25%;
@http是一个变量
这样书写会不现实,也没有解析!
请问该怎么办?
调用方式错了,不用那个美元符号
@http: http://www.yoursite.com; // 对变量@http的定义, 习惯上写在less文件开头
background: url(@http/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
10 回答11.2k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.8k 阅读✓ 已解决
3 回答2.3k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
找到答案了 应该是
background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;