HTML DOM Body propriétés de fond
Définition et utilisation
ensembles de propriétés de fond ou renvoie la valeur des attributs d'arrière-plan de l'élément de corps.
attribut background décrit l'image d'arrière-plan du document.
grammaire
bodyObject.background=URL
support du navigateur
Tous les principaux navigateurs prennent en charge les attributs de fond.
Exemples
Exemples
Renvoie l'attribut de l'élément de corps de fond:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body id="logo" background="logo.png">
<script>
document.write("背景图片是: ")
document.write(document.getElementById("logo").background);
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body id="logo" background="logo.png">
<script>
document.write("背景图片是: ")
document.write(document.getElementById("logo").background);
</script>
</body>
</html>
Essayez »
Objet du corps