Body background 属性

定义和用法
background 属性可设置或者返回 body 元素background属性的值。
background 属性描述了文档的背景图片。
语法
bodyObject.background=URL
浏览器支持
所有主要浏览器都支持 background 属性。
实例
返回 body 元素的background属性值:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> </head> <body id="logo" background="/examples/logo.png"> <script> document.write("背景图片是: ") document.write(document.getElementById("logo").background); </script> </body> </html>
