Définition du JS backgroundColor.
La propriétés Javascript backgroundColor CSS permet de spécifier en Javascript la couleur de fond de l'élément.
oDomElement.style.backgroundColor= "tomato";
oDomElement.style.backgroundColor = "rgb(60,179,113)";
oDomElement.style.backgroundColor = "#4682B4"; backgroundColor CSS peut prendre toutes les valeurs de la propriété CSS background-color.La propriété CSS backgroundColor renvoie une valeur de type String :
- rgb(0, 0, 0) par défaut pour la valeur calculée et vide pour la valeur locale.
- ou la valeur calculée au format RGB ou RGBA pour la valeur calculée sauf pour
transparentou la valeur spécifiée pour la valeur locale.
Exemple de code backgroundColor JS
Conditions d'application de la CSS backgroundColor.
La propriété Javascript backgroundColor s'applique dans les mêmes conditions que la propriété CSS background-color.
Problème d'interprétation de backgroundColor en JS.
Pas de problÚme spécifique à la propriété Javascript backgroundColor.
Pour les problÚmes plus généraux non liés au Javascript, consultez la définition CSS de la propriété background-color.
Compatibilités navigateurs
- Détails des versions de la CSS backgroundColor
- Propriété
backgroundColorest compatible avec CSS1 et plus. - Propriété
backgroundColorest compatible avec CSS2 et plus. - Propriété
backgroundColorest compatible avec CSS3 et plus.
Votre avis sur la définition backgroundColor en JS
Votez pour la définition CSS backgroundColor
- 1/5
- 2/5
- 3/5
- 4/5
- 5/5
Votes: 3.1 / 5 - 9
votes
Cliquez sur une étoile pour voter.