【问题标题】:syntax error - JS - background.style.backgroundImage语法错误 - JS - background.style.backgroundImage
【发布时间】:2016-10-30 15:13:10
【问题描述】:

这有效并且图像呈现。

body.style.backgroundImage = 'url(0.gif)';

这不起作用,图像根本不渲染。

body.style.backgroundImage = 'url(0.gif) no-repeat center center fixed';

控制台中没有错误。

我在这里缺少什么?这应该有效。第二个在语法上是正确的,对吧?

【问题讨论】:

    标签: javascript html syntax


    【解决方案1】:

    请改用body.style.backgroundbody.style.backgroundImage 仅用于图像。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-26
      • 1970-01-01
      • 1970-01-01
      • 2017-05-11
      • 2018-12-04
      • 2017-08-09
      • 1970-01-01
      • 2019-05-08
      相关资源
      最近更新 更多