javascript - background:url problem in less
ringa_lee
ringa_lee 2017-05-19 10:30:55
0
2
629

background: url(${@http}/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;

@http is a variable
It would be unrealistic to write it this way, and there would be no analysis!

Ask how to do?

ringa_lee
ringa_lee

ringa_lee

reply all(2)
淡淡烟草味

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

@http: http://www.yoursite.com;   // 对变量@http的定义, 习惯上写在less文件开头

background: url(@http/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template