Body background 屬性

定義和用法
background 屬性可設(shè)置或者返回 body 元素background屬性的值。
background 屬性描述了文檔的背景圖片。
語法
bodyObject.background=URL
瀏覽器支持
所有主要瀏覽器都支持 background 屬性。
實(shí)例
實(shí)例
返回 body 元素的background屬性值:
<html>
<body id="logo" background="logo.png">
<script>
document.write("The background image is: ")
document.write(document.getElementById("logo").background);
</script>
</body>
</html>
<body id="logo" background="logo.png">
<script>
document.write("The background image is: ")
document.write(document.getElementById("logo").background);
</script>
</body>
</html>
嘗試一下 ?

更多建議: