为什么Firefox放在css中时无法读取带空格的图像路径?

Quh*_*hby 3 css firefox

例如,像css中的这个规则

div.something { background-image: url(http://i2.photobucket.com/albums/y24/5609903697/Beyond Birthday/BB39.jpg); }

不会在FF中工作,但会在IE中工作,因为"Beyond"和"Birthday"之间有一个空格.我知道解决方案是要么没有空间,要么放%20%,但只是想知道为什么IE可以处理这个而FF不能.

Joh*_*han 11

你试过用单引号围绕网址吗?

background-image: url('/folder/file name.jpg');
Run Code Online (Sandbox Code Playgroud)

这并没有回答为什么部分,但我认为这是因为IE只是更宽容,Firefox正确解析CSS.