显示所有DOM元素的border,方便调试网页元素的相对布局。
* {outline: auto;
}
如何用javascript设置某个网页的style(复制以下代码到浏览器控制台执行即可)?
// wuyujin1997
var styleString = "* { outline: auto; }"; // 要添加的CSS值
var styleValue = document.createTextNode(styleString); // 创建文本值
var styleNode = document.createElement("style"); // 创建DOM节点
styleNode.appendChild(styleValue); // 把文本值设置/嵌套到DOM节点中
document.head.appendChild(styleNode); // 把准备好的