Jump to content

CSS Gradient Background

Recommended Posts

Hi,

I'm currently working on building a site. I wanted to use this code to have an animated gradient background.

body {
  margin:0;
}
.wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    background: linear-gradient(60deg,#fffdf8, #ffcae0);
    background-size: 600% 100%;
    animation: gradient 5s linear infinite;
    animation-direction: alternate;
}
@keyframes gradient {
    0% {background-position: 0%}
    100% {background-position: 100%}
}

 

I've pasted in to 'Custom CSS' section but can't see it working. Do I need to add some more code for it to work?

 

This is the link to the css I want to use.

https://codepen.io/redstapler/pen/LMyLxP

 

Thanks in advance.

Edited by ToldTales
Missed a link out
Link to comment
3 hours ago, ToldTales said:

Hi,

I'm currently working on building a site. I wanted to use this code to have an animated gradient background.

body {
  margin:0;
}
.wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    background: linear-gradient(60deg,#fffdf8, #ffcae0);
    background-size: 600% 100%;
    animation: gradient 5s linear infinite;
    animation-direction: alternate;
}
@keyframes gradient {
    0% {background-position: 0%}
    100% {background-position: 100%}
}

 

I've pasted in to 'Custom CSS' section but can't see it working. Do I need to add some more code for it to work?

 

This is the link to the css I want to use.

https://codepen.io/redstapler/pen/LMyLxP

 

Thanks in advance.

Do you want to set this effect on an unique section or entire your page?

Kindly share your site with the protected password to check it together

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
On 12/3/2021 at 2:09 AM, ToldTales said:

It would be great to have it as the entire page.

https://vuvuzela-mackerel-m37a.squarespace.com

password: cssbackground

Thanks for your help

Is it the result you want to achieve?

 Try adding to Home > Design > Custom Css
section, section .content-wrapper, section .section-background {
  background: transparent !important;
}
#siteWrapper {
  background: linear-gradient(45deg,#F17C58, #E94584, #24AADB , #27DBB1,#FFDC18, #FF3706);
  background-size: 600% 100%;
  animation: gradient 16s linear infinite;
  animation-direction: alternate;
}


@keyframes  gradient {
  0% {background-position: 0%;}
  100% {background-position: 100%;}
}

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 1 month later...
On 12/4/2021 at 3:38 AM, bangank36 said:

Is it the result you want to achieve?

 

 Try adding to Home > Design > Custom Css
section, section .content-wrapper, section .section-background {
  background: transparent !important;
}
#siteWrapper {
  background: linear-gradient(45deg,#F17C58, #E94584, #24AADB , #27DBB1,#FFDC18, #FF3706);
  background-size: 600% 100%;
  animation: gradient 16s linear infinite;
  animation-direction: alternate;
}


@keyframes  gradient {
  0% {background-position: 0%;}
  100% {background-position: 100%;}
}

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

hey @bangank36 how can I do this to target just one section of a page? I am trying to wrap the CSS you provided within a data section ID, and then it stops working.

Thanks in advance!

Edited by happyscone
Link to comment
On 1/22/2022 at 5:49 AM, happyscone said:

how can I do this to target just one section of a page? I am trying to wrap the CSS you provided within a data section ID, and then it stops working.

Thanks in advance!

try this CSS

[data-section-id="id here id here"] {
&, .content-wrapper, .section-background {
  background-color: transparent !important;
}
.section-background {
background: linear-gradient(45deg,#F17C58, #E94584, #24AADB , #27DBB1,#FFDC18, #FF3706);
  background-size: 600% 100%;
  animation: gradient 16s linear infinite;
  animation-direction: alternate;
}
}
@keyframes  gradient {
  0% {background-position: 0%;}
  100% {background-position: 100%;}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
33 minutes ago, tuanphan said:

try this CSS

[data-section-id="id here id here"] {
&, .content-wrapper, .section-background {
  background-color: transparent !important;
}
.section-background {
background: linear-gradient(45deg,#F17C58, #E94584, #24AADB , #27DBB1,#FFDC18, #FF3706);
  background-size: 600% 100%;
  animation: gradient 16s linear infinite;
  animation-direction: alternate;
}
}
@keyframes  gradient {
  0% {background-position: 0%;}
  100% {background-position: 100%;}
}

 

Thanks @tuanphan this worked! 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.