Create a gradient text effect like Vercel with CSS
Sam

Sam @mohsenkamrani

About: I write about AI, ML, MLOps, programming. Open-source repository: https://github.com/0dev-hq/0dev

Location:
Australia
Joined:
Jan 4, 2022

Create a gradient text effect like Vercel with CSS

Publish Date: Dec 30 '22
20 4

Gradient overlay is one of the coolest yet simplest effects that has become very popular in recent years.

In this short tutorial, I'll show you how to create such an effect like what you see on sites like Vercel very easily.

Before we move on, remember you can implement your websites, landing pages, APIs, and more, with or without coding on DoTenX for free. Make sure to check it out and even nominate your work to be showcased.DoTenX is open-source and you can find the repository here: github.com/dotenx/dotenx.


We start by adding the text to the page:

<span class="gradient-text">Develop.</span>
Enter fullscreen mode Exit fullscreen mode

Now let's set the background-image:

.gradient-text {
    background-image: linear-gradient(90deg,#007CF0,#00DFD8);
}
Enter fullscreen mode Exit fullscreen mode

As you see this is the gradient colour we want, but not as the background.

Now let's make the text transparent:

    -webkit-text-fill-color: transparent;
Enter fullscreen mode Exit fullscreen mode

Finally, we set the background-clip property:

background-clip: text;
-webkit-background-clip: text;
Enter fullscreen mode Exit fullscreen mode

And this is the result:

Simple, yet effective!

Comments 4 total

  • Arek Krysik
    Arek KrysikDec 30, 2022

    Pretty cool! Thanks!

    • Sam
      SamDec 30, 2022

      I'm glad you find it helpful.

  • Amir-cahyadi
    Amir-cahyadiDec 31, 2022

    ❤️👍 thaks for ur info sir

    • Sam
      SamDec 31, 2022

      I'm glad you find this helpful.

Add comment