Aller au contenu principal
Partagez cette démonstration :

Effet gold sur texte avec CSS

Dernière mise à jour : novembre 2022

Le code :



<div class=cadre>
<span class="gold" data-gold=gold>GOLD</span>
</div>





*,*::before,*::after{box-sizing: border-box;}



.gold {

background: linear-gradient(#cfc09f 0%, #634f2c 10%, #cfc09f 40%, #ffecb3 50%, #3a2c0f 80%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
position: relative;
display: flex;
justify-content: center;
text-transform: uppercase;
line-height: calc(100vw / 6);
font-size: calc(100vw / 6);
font-weight: bold

}

.gold::before {

content: attr(data-gold);
left: 5px;
top: 0;
z-index: -1;
position: absolute;
text-shadow: 
-1px 0 1px #c6bb9f, 
0 1px 1px #c6bb9f, 
5px 5px 10px rgba(0, 0, 0, 0.4), 
-5px -5px 10px rgba(0, 0, 0, 0.4);

}





Vous rencontrez un problème avec cette démonstration ?

Vous avez constaté un oubli ou une erreur dans le code ? N'hésitez pas à me le signaler par mail (contact@guyom-design.com). Vous ne parvenez pas à faire fonctionner la démonstration ? Vous pouvez également me contacter et je vous aiderai si je le peux.