propriété HTML DOM style backgroundRepeat
Définition et utilisation
ensembles de propriétés backgroundRepeat ou retourne comment répéter une image d'arrière-plan.
grammaire
Définition des propriétés backgroundRepeat:
Object.style.backgroundRepeat="repeat|repeat-x|repeat-y|no-repeat|inherit"
Retour propriétés backgroundRepeat:
Object.style.backgroundRepeat
值 | 描述 |
---|---|
repeat | 默认。垂直和水平方向重复背景图像。 |
repeat-x | 水平方向重复背景图像。 |
repeat-y | 垂直方向重复背景图像。 |
no-repeat | 不重复背景图像。 |
inherit | background-repeat 属性的设置从父元素继承。 |
support du navigateur
Tous les principaux navigateurs prennent en charge la propriété backgroundRepeat.
Note: IE7 et les versions antérieures ne supportent pas la valeur "inherit".IE8 ne fournit DOCTYPE! Supporté "inherit". soutien IE9 "inherit".
Exemples
Exemples
Image de fond répété dans la direction verticale:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Style type = "text / css">
body {
background: # F3F3F3 url ( 'img_tree.png');
}
</ Style>
<Script>
fonction displayResult () {
document.body.style.backgroundRepeat = "repeat-y";
}
</ Script>
</ Head>
<Body>
<Bouton type = "button" onclick = "displayResult ()"> image verticale répétition de fond </ button>
<br>
<H1> Bonjour tout le monde! </ H1>
<P> Ceci est un paragraphe </ p>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Style type = "text / css">
body {
background: # F3F3F3 url ( 'img_tree.png');
}
</ Style>
<Script>
fonction displayResult () {
document.body.style.backgroundRepeat = "repeat-y";
}
</ Script>
</ Head>
<Body>
<Bouton type = "button" onclick = "displayResult ()"> image verticale répétition de fond </ button>
<br>
<H1> Bonjour tout le monde! </ H1>
<P> Ceci est un paragraphe </ p>
</ Body>
</ Html>
Essayez »
style Objets