Here’s something that looks fun.

Gradient Text!

Even Animation!

Here’s the fiddle:

Of course, you’d want it in your own colors, right?

So just head on over to
Ultimate CSS Gradient Editor
for the gradient css codes and

Gradient Animator
for the animation.

 

Now that you’re all ready with your links and css codes and stuff, we can dive in.

Basically, what we’re going to do is take those gradients and use them as backgrounds to punched-out text.

 

So we take two elements: the background, and the punched out text.

Here’s an example of a gradient:

h1.grad-back {
background: rgb(181,189,200); 
background: -moz-linear-gradient(left, rgba(181,189,200,1) 0%, rgba(130,140,149,1) 36%, rgba(40,52,59,1) 100%); 
background: -webkit-linear-gradient(left, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%);
background: linear-gradient(to right, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); 
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b5bdc8', endColorstr='#28343b',GradientType=1 ); }

and here’s some punched out text:

.clipped {
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;}

Add them together, and we get:

h1.grad-back {
background: rgb(181,189,200); 
background: -moz-linear-gradient(left, rgba(181,189,200,1) 0%, rgba(130,140,149,1) 36%, rgba(40,52,59,1) 100%); 
background: -webkit-linear-gradient(left, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%);
background: linear-gradient(to right, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); 
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b5bdc8', endColorstr='#28343b',GradientType=1 ); 
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

So that’s the first one. The one with just the gradient background.

Here’s what the animation looks like:

h1.moving {
background: linear-gradient(270deg, #5b20ad, #2da9ef, #06b050, #e6da25);
background-size: 800% 800%;
-webkit-animation: blockbusteranimation 8s ease infinite;
-moz-animation: blockbusteranimation 8s ease infinite;
-o-animation: blockbusteranimation 8s ease infinite;
animation: blockbusteranimation 8s ease infinite;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
@-webkit-keyframes blockbusteranimation {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@-moz-keyframes blockbusteranimation {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@-o-keyframes blockbusteranimation {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@keyframes blockbusteranimation { 
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}

So it’s pretty cool!

However… One problem:
As is with everything good on the internet, this does not work on IE.
Notice the “-webkit” part? Yeah, it doesn’t work on IE. So, you should probably add an IE specific stylesheet that just gives the text a single color.

So there you have it! A pretty awesome way to get gradients behind your text without using images. (for the modern browser people)

PS. The Divi theme version will be up real soon, and the link is here.
 

To learn more about CSS, check out this comprehensive course that covers everything about using CSS with Divi! (use coupon code "getcoursewith5off" for 5% off) Start learning proper CSS for Divi

 
To learn more about CSS, media queries, Flexbox and/or responsive web design, check out this course! (use coupon code "getcoursewith5off" for 5% off) Learn how to make Divi more responsive

 
 

Notice

Hi! Please consider signing up for my newsletter for... two emails (at most) a month of news, updates, and special offers, including child themes and more courses. Sound interesting? The signup form is right here!

You will also get a discount coupon in your inbox as soon as you sign up!


 

Photo by Sam Headland on Unsplash