Jump to content

Make background two different colors on top and bottom

Recommended Posts

Posted

Site URL: http://www.littleemberslearning.co

@tuanphan

I am trying to make a two-toned background on a specific page using SquareSpace 7.1. I can't seem to target the right element. It works ok on desktop but not on mobile. It seems like it's not targeting the entire background. Here is the code I'm using:

/*Background half color*/
div#page-section-5ebb04baaf3da51700fbbdba{
  background: linear-gradient(0deg, #264a53 60%, #fff 40%);
}
@media only screen and (max-width: 640px){
div#page-section-5ebb04baaf3da51700fbbdba {
  background: linear-gradient(0deg, #264a53 80%, #fff 20%);
}
}

Any help would be appreciated! 

mobile-little-embers.jpg

  • Replies 7
  • Views 2.7k
  • Created
  • Last Reply
Posted

I want the top half of my home page body section to be white. I want the bottom half of the body section to be #264a53. If you look on mobile, it's not targeting the entire body section.

Posted

I figured it out. Squarespace 7.1 doesn't have page identifiers so I had to find the section-id. Thanks @tuanphan for getting me going in the right directions.

Here's the code I used:

[data-section-id="5ebb04baaf3da51700fbbdba"] .section-background
  {
  background: linear-gradient(0deg, #264A53 60%, #FFF 40%);
  }

 

Posted
On 5/27/2020 at 9:38 AM, LittleEmbers said:

I want the top half of my home page body section to be white. I want the bottom half of the body section to be #264a53. If you look on mobile, it's not targeting the entire body section.

Hi. Did you solve?

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!)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.