4

Time for 3 hours I checked why LESS doesn't set the background image for the needed container. Please, if someone can tell me what's wrong in my script(I tried all the possibilities found on stackoverflow but nothing worked for me).

This is my code:

@imagesDir:"../images/newImages18072013";
#header
{
    background-image: url("@{imagesDir}/headerBack.gif");
}

The result in browser it's:

#header {
           background-image: url("@{imagesDir}/headerBack.gif");
}

So, everything I tried I obtained the same result in browser, it looks like it's not processed.

Pufi
  • 360
  • 1
  • 3
  • 14

1 Answers1

7

Are you writing it wrong perhaps?

@base-url: "http://assets.fnord.com";
background-image: url("@{base-url}/images/bg.png");

From: http://lesscss.org/#-string-interpolation

Johan Bouveng
  • 565
  • 2
  • 8
  • Yesterday I started to learn LESS and it seems that I'll have some headaches. Your code it's working and I understand that I can't declare any name for the url variable and I'm forced to use "@base-url" . Thanks – Pufi Jul 18 '13 at 10:13