【问题标题】:Background image set wrong by firefox and ieFirefox 和 ie 设置错误的背景图像
【发布时间】:2012-06-21 03:53:45
【问题描述】:

我一直在开发页面构建器,但遇到了这个双引号问题。

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"

当页面被保存并重新加载时,双引号会破坏样式。

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

【问题讨论】:

    标签: background background-image quotes


    【解决方案1】:

    我认为问题在这里 - 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">
    

    【讨论】:

      猜你喜欢
      • 2012-05-23
      • 1970-01-01
      • 2016-02-29
      • 2011-03-22
      • 1970-01-01
      • 2011-10-13
      • 1970-01-01
      • 2012-11-25
      • 2012-06-11
      相关资源
      最近更新 更多