Guest Posted December 2, 2021 Posted December 2, 2021 (edited) 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 December 2, 2021 by ToldTales Missed a link out
Beyondspace Posted December 2, 2021 Posted December 2, 2021 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 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
Guest Posted December 2, 2021 Posted December 2, 2021 It would be great to have it as the entire page. https://vuvuzela-mackerel-m37a.squarespace.com password: cssbackground Thanks for your help
Beyondspace Posted December 4, 2021 Posted December 4, 2021 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? gradient background.mp4 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 happyscone 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
happyscone Posted January 21, 2022 Posted January 21, 2022 (edited) On 12/4/2021 at 3:38 AM, bangank36 said: Is it the result you want to achieve? gradient background.mp4 1.62 MB · 3 downloads 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 January 21, 2022 by happyscone
tuanphan Posted January 25, 2022 Posted January 25, 2022 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%;} } happyscone 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
happyscone Posted January 25, 2022 Posted January 25, 2022 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!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment