扫码关注官方订阅号
background: url(${@http}/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
${@http}/img/icon/daorug@2x.png
@http是一个变量这样书写会不现实,也没有解析!
请问该怎么办?
ringa_lee
找到答案了 应该是background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
调用方式错了,不用那个美元符号
@http: http://www.yoursite.com; // 对变量@http的定义, 习惯上写在less文件开头 background: url(@http/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
找到答案了 应该是
background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
调用方式错了,不用那个美元符号