background: url(${@http}/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
${@http}/img/icon/daorug@2x.png
@http is a variableIt would be unrealistic to write it this way, and there would be no analysis!
Ask how to do?
ringa_lee
I found the answer, it should be 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%;
The calling method is wrong, don’t use the dollar sign
@http: http://www.yoursite.com; // 对变量@http的定义, 习惯上写在less文件开头 background: url(@http/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
I found the answer, it should be
background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
The calling method is wrong, don’t use the dollar sign