css background gradient animation

How we can create movie gradient for the background using pure CSS? Solution: CSS Gradient Background Animation. In other words, Pure CSS moving gradient.

Previously I have shared a random gradient generator, but this is a simple moving gradient for background or on any element. Basically, a gradient is a mix of more than one color, that we can easily create using CSS for websites. I have shared some posts on gradient topic first, check out those.

Today you will learn to create a moving gradient background for your website. This is a basic and easy concept, one of our visitors asks me for creating this that’s why I am sharing this. After seeing this post, you will able to understand how CSS gradients work and how to create. Codes of this design are very easy, even a beginner understand quickly.

So, Today I am sharing CSS Gradient Background Animation. This is a normal linear gradient on the body with moving animation, that’s why I am calling it animated background gradient. There I have used some simple CSS properties like linear-gradient, background-size, animation, etc.

If you are thinking now how this moving background actually is, then see the preview given below.

Preview Of Moving Gradient

See this video preview to getting an idea of how this design looks like.

Live Demo

Now you can see this visually, you also can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

CSS Gradient Background Animation Source Code

Before sharing source code, let’s talk about it. I have created just one div for text otherwise, the gradient is on the body element. I have used a google font (get) for styling the headings on the design. In HTML file I have done these works only like put first heading, second heading, and link the font.

Now in the CSS file, I have placed gradient on the body tag. I have placed a linear gradient with four colors and -45 degrees angle, now the whole command line looks like this: background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab ); . After that, I have created an animation using CSS @keyframe  and put 3 stage animation at 0%, 50%, and 100%.

Left other basic things you will understand easily after getting the codes, I can’t explain all in writing. For creating this you have to create only 2 files, one for HTML and one for CSS. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given here below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

That’s It. Now you have successfully created CSS Gradient Background Animation, Pure CSS Moving Gradient. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here