背景图像设置错误的firefox和ie

时间:2012-06-21 03:53:46

标签: background background-image quotes

我一直在处理页面构建器,并遇到了这个双引号问题。

div id="set" style="color:black;font-size:12px"

document.getElementById('set').style.backgroundImage="url('editor.png')"

document.getElementById('set').style.backgroundImage="url(editor.png)"

这在firefox和IE中设置

div id="set" style="url("editor.png");color:black;font-size:12px"

当页面被保存并重新加载时,双引号将分解样式。

有没有人知道这个问题的解决方法?

1 个答案:

答案 0 :(得分:0)

我认为问题在这里 - url(“editor.png”)

<div id="set" style="url("editor.png");color:black;font-size:12px">


试试这个

<div id="set" style="background-image :url('editor.png');color:black;font-size:12px">
相关问题