Why an inline "background-image" style doesn't work in Chrome 10 and Internet Explorer 8?

Misha Moroshko picture Misha Moroshko · May 1, 2011 · Viewed 291.6k times · Source

Why the following example shows the image in Firefox 4, but not in Chrome 10 and Internet Explorer 8?

HTML:

<div style="background-image: url('http://www.mypicx.com/uploadimg/1312875436_05012011_2.png')"></div>

CSS:

div {
    width: 60px;
    height: 60px;
    border: 1px solid black;
}

Any ideas for workarounds?

Answer

Misha Moroshko picture Misha Moroshko · May 1, 2011

As c-smile mentioned: Just need to remove the apostrophes in the url():

<div style="background-image: url(http://i54.tinypic.com/4zuxif.jpg)"></div>

Demo here