Propriété borderImage de style
Exemple
Spécifiez une image comme bordure autour d'un élément <div> :
document.getElementById("myDIV").style.borderImage = "url(border.png) 30 30 round";
Définition et utilisation
La propriété borderImage est une propriété abrégée permettant de définir les propriétés borderImageSource , borderImageSlice , borderImageWidth , borderImageOutset et borderImageRepeat .
Les valeurs omises sont définies sur leurs valeurs par défaut.
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Les nombres suivis de Webkit, Moz ou O spécifient la première version qui a fonctionné avec un préfixe.
Property | |||||
---|---|---|---|---|---|
borderImage | 16.0 4.0 Webkit |
11.0 | 15.0 3.5 Moz |
6.0 3.1 Webkit |
15.0 11.0 O |
Syntaxe
Renvoyez la propriété borderImage :
object.style.borderImage
Définissez la propriété borderImage :
object.style.borderImage = "source slice width outset repeat|initial|inherit"
Valeurs de propriété
Value | Description |
---|---|
borderImageSource | The path to the image to be used as a border |
borderImageSlice | The inward offsets of the image-border |
borderImageWidth | The widths of the image-border |
borderImageOutset | The amount by which the border image area extends beyond the border box |
borderImageRepeat | Whether the image-border should be repeated, rounded or stretched |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Détails techniques
Valeur par défaut: | aucun 100% 1 0 étirement |
---|---|
Valeur de retour : | Une chaîne, représentant la propriété border-image d'un élément |
Version CSS | CSS3 |
Pages connexes
Référence CSS : propriété border-image