Background Color(set to gradient) changing when adding text

So I created my own color gradient via this website

I then pasted it into the CSS for my project.
However, I can’t seem to rotate the direction of the gradient? I’m trying to make it go from top left down to bottom right rather than horizontally?

Also, if I insert text in the h1 element, the background changes for some reason?

why is this?

You can. Just change that: (40deg, ((colors)) )

Add that to your code:

  background-repeat: no-repeat;
  height: 100vh;
1 Like

I’ve changed the 40deg to 70deg however it looks exactly the same?

Added the background-repeat and that solved it. Thank a lot.

Ummm… I can’t see your updated pen

As you can see the direction of the gradient is the exact same as it was in the previous version of the pen I originally posted. The only observable difference I’m seeing when I change the degrees is the definition of those horizontal divisions. I can’t figure out why those horizontal divisions are there in the first place.

That is background-repeat. Use:

See that

Every CSS Background Property Illustrated and Explained with Code Examples 🎖️

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.