0

I am trying to add a background image to my HTML website, but the syntax I am using doesn't work, and isn't displaying the image at all:

background-image:url('My Designs/down-arrows.png');

Anyone know if there is an error in this? or is there an equivalent I can use for HTML?

Many thanks, Adam

bjhaid
  • 9,592
  • 2
  • 37
  • 47

1 Answers1

1

Yes, the error is that you can't have a space character in the URL:

background-image:url('My Designs/down-arrows.png');

You could use %20?:

background-image:url('My%20?Designs/down-arrows.png');

But better to change your folder to not use the space at all.

danwarfel
  • 890
  • 1
  • 6
  • 13
  • Tried adding in %20 and still didn't work, ill try remove the space from the file name, Thanks! –  Feb 08 '14 at 23:37
  • 1
    Doesn't work in all browsers. [Read this answer here](http://stackoverflow.com/a/497972/2997710) – danwarfel Feb 08 '14 at 23:44