如何将整个脚本对齐到中心位置?我从来没有真正用JavaScript编码过,我只是想修改一个快速书签。我已经尝试过像align = center这样的脚本的不同组件,但没有运气。是否有像<center>
(在html中)为js?JavaScript中心对齐
感谢
编辑:基本上,我想这是一个页面
function dEmbed(){
var iframe = document.createElement("iframe");
iframe.src = 'http://www.google.com';
iframe.style.width = w+'px';
iframe.style.height= h+'px';
iframe.style.border= "0";
iframe.style.margin= "0";
iframe.setAttribute("scrolling","no");
iframe.setAttribute("id","NAME");
document.body.insertBefore(iframe, document.body.firstChild);
}
请给我们更多的细节 - 你的术语是混杂起来的,很难理解你要做什么。 (特别是请不要像你这样使用文字脚本。) – Ariel
我编辑了我的文章 – Cody
查看下面我编辑的答案,我解决了你的问题。 –