Jump to content

CSS to change mobile site-wide background (forte template)

Recommended Posts

Hello everyone,

I chose the forte template as it allows me to have one site-wide background but on mobile view the focal point that is chosen by Squarespace looks really crappy.

Is there a CSS code that allows me to chose a different focal point OR a different background image for mobile? I know it can be done with banners and cover pages on other templates, but I'd rather keep the site with forte.

Thanks!

Link to comment
  • Replies 7
  • Views 1.6k
  • Created
  • Last Reply

@jodaro Add to Home > Design > Custom CSS. REmember replacing image url.


/* Background Image on only mobile */
@media screen and (max-width:640px) {
body:not(.collection-type-index):not(.collection-type-gallery) {
   background-repeat: no-repeat;
   background-image: url(https://static1.squarespace.com/static/57f9478…/t/5d35ee7…/1563815567545/TMF-1132-2.jpg) !important;
   background-position: center center;
   background-size: cover;
   background-attachment: scroll;
}}


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

Link to comment

Thanks for the tip Tuanphan!!! This worked, we ran into complications hosting the photo that we wanted to display. In the meantime, another friend offered a simpler solution: restricting the pixel height of the wide-angle photo in mobile. with this limitation, Squarespace effectively cropped the image.

Link to comment
  • 1 year later...
8 minutes ago, jettstrauss said:

can i ask how one could apply this mobile background image to only a home page?

Add to Page Settings > Advanced > Header

<style>
  /* Background Image on only mobile */
@media screen and (max-width:640px) {
body:not(.collection-type-index):not(.collection-type-gallery) {
   background-repeat: no-repeat;
   background-image: url(https://static1.squarespace.com/static/57f9478…/t/5d35ee7…/1563815567545/TMF-1132-2.jpg) !important;
   background-position: center center;
   background-size: cover;
   background-attachment: scroll;
}}
</style>

 

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

Link to comment

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.