Snippets: Multi color text with CSS
*, *::before, *::after { outline: none; box-sizing: border-box; margin: 0; padding: 0; } :root { --color-1: #186cb8; --color-2: #2a9a9f; --color-3: #f1b211; --color-4: #e83611; --color-5: #f9002f; } .wrapper { background: #000; line-height: 1; min-height: 100%; display: grid; place-items: center; min-height: calc(100vh - 16px); } h1 { font-family: "Exo", sans-serif; font-size: 15vw; font-weight: 900; width: -webkit-min-content; width: -moz-min-content; width: min-content; margin: auto; text-transform: uppercase; background: linear-gradient(219deg, var(--color-1) 19%, transparent 19%,transparent 20%, var(--color-2) 20%, var(--color-2) 39%, transparent 39%,transparent 40%, var(--color-3) 40%,var(--color-3) 59% , transparent 59%,transparent 60%, var(--color-4) 60%, var(--color-4) 79%, transparent 79%, transparent 80%, var(--color-5) 80%); background-clip: text; -webkit-background-clip: text; color: transparent; } .container { padding: 1.5rem; text-align: center; background: radial-gradient(circle at 1.4% 1.4% ,var(--color-1) .8%,transparent .8% ), radial-gradient(circle at 5.5% 3%,var(--color-2) .45% ,transparent .45% ), radial-gradient(circle at 2.5% 3.5%,var(--color-3) .5% ,transparent .5% ), radial-gradient(circle at 4.5% 1.2%,var(--color-4) .25%,transparent .25% ), radial-gradient(circle at 98% 98% ,var(--color-1) .8%,transparent .8% ), radial-gradient(circle at 95% 95%,var(--color-2) .45% ,transparent .45% ), radial-gradient(circle at 94.5% 97.5%,var(--color-3) .5% ,transparent .5% ), radial-gradient(circle at 98.5% 95.5%,var(--color-4) .25%,transparent .25% ); } @media screen and (min-width: 768px) { h1 { font-size: 6.5rem; } }
CSS Before Head
HTML Head
CSS After Head
JS Before HTML Body
<div class="wrapper"> <div class="container"> <!--<h1>multi color text with css</h1>--> <h1>Faux Pas of Mine</h1> </div> </div>
HTML Body
HTML Foot
JS After HTML Body
Full HTML Code