Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Enregistrer le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <head> <style> div { couleur de fond: rgb(4, 170, 109); padding: 10px; } div.first { couleur-de-fond: rgba(4, 170, 109, 0.1); } div.second { couleur-de-fond: rgba(4, 170, 109, 0.3); } div.third { couleur de fond: rgba(4, 170, 109, 0.6); } </style> </head> <body> <h2>Opacité vs valeurs RGBA</h2> <p>Avec l'opacité (le texte devient également transparent) :</p> <div style="opacity:0.1;"><p>10% d'opacité</p></div> <div style="opacity:0.3;"><p>30% d'opacité</p></div> <div style="opacity:0.6;"><p>60% d'opacité</p></div> <div><p>opacité 1</p></div> <p>Avec la couleur de fond et RGBA (le texte est complètement opaque) :</p> <div class="first"><p>10% d'opacité</p></div> <div class="second"><p>30% d'opacité</p></div> <div class="third"><p>60% d'opacité</p></div> <div><p>par défaut</p></div> </body> </html>