Applying animated gradient to backgrounds
-
Hi Armin,
Still really loving Lay Theme! I'm just wondering if you could please give instructions for adding an animated gradient background via https://www.gradient-animator.com/ ? I have seen a few topics discussing this but cannot find clear instructions for how to do it.
I understand it can be done via CSS but tried to copy and paste code into CSS editor and it doesn't work. I'd like to apply the gradient to selected pages of my site.
Thank you!
-
Dear @alidarosie
Can you post a link to our website?
Then we can have a look and inspect that.You would probably need to paste it into the body tag.
Best!
Marius
-
Thank you for your reply Marius - I actually managed to do it using CSS! For anyone who may find it useful, here is how I entered the code in custom CSS:
body.slug-pagename {
background: #eaffff;
background: linear-gradient(270deg, #ffffff, #eaffff, #fdffeb);
background-size: 800% 800%;-webkit-animation: gradient-title 21s ease infinite;
-moz-animation: gradient-title 21s ease infinite;
animation: gradient-title 21s ease infinite;
}@-webkit-keyframes gradient-title {
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
}
@-moz-keyframes gradient-title {
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
}
@keyframes gradient-title {
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
} -
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it