CSS problem with visibilty
开发者_运维技巧I have the following code:
var d = document.createElement("div");
d.id = "d_1";
d.style.backgroundImage = "url(img/lr.png");
d.style.backgroundRepeat = "no-repeat";
d.style.width = "150px";
d.style.height = "25px";
d.style.position = "absolute";
d.style.left = "460px";
d.style.top = "385px";
d.style.visibility = "visible";
document.documentElement.appendChild(d);
and that div isn't show with Opera and Chrome but it's show with firefox!
What's wrong?
Syntax error.
d.style.backgroundImage = "url(img/lr.png");
Should be
d.style.backgroundImage = "url(img/lr.png)";
Correct this line:
d.style.backgroundImage = "url(img/lr.png");
to
d.style.backgroundImage = "url(img/lr.png)";
精彩评论