Jump to content

Make second footer section sticky for mobile

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Hi,

I have a problem with making my second footer section sticky for mobile use. I have made two footer section, section 1 only visible for desktop use, section 2 only visible for mobile us. The desktop footer (section one) don't have to be sticky. Section two must be sticky. If I use this CSS, as mentioned in instruction video, the mobile footer won't stay sticky.  Could you please help me?

#footer-sections .page-section:last-of-type   {
position: fixed!important;
width: 100%!important;
bottom: 0!important;
z-index: 99!important 
}
/* Hide this on Tablet - Desktop */
@media screen and (min-width:768px) {
    [data-section-id="65908a58c056a6178ddb0923"] {
        display: none;
    }
}
// Hiding sections on mobile
@media screen and (max-width: 641px) {
section[data-section-id="659091cc44189d1cbbceb870"] {
 display:none !important;
  }
}
Footer {
    border-top: 1px solid ;
  }
 

 


Website:  www.studioswoop.nl

key; !Uchtball0n

 

Thanks

 

  • Replies 3
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted

Hi,

That's because I haven't added a footer for desktop yet.  I have added it now...

As you can see I have different footersections, several for mobile (which should serve as navigation buttons) and one for the entire desktop website. But with the current CSS the desktop footer stays sticky too. In stead this one doens't stay sticky.

Thanks in advance

  • Solution
Posted

To make mobile footer sticky only, change this your code

#footer-sections .page-section:last-of-type   {
position: fixed!important;
width: 100%!important;
bottom: 0!important;
z-index: 99!important 
}

to this

@media screen and (max-width:767px) {
#footer-sections .page-section:last-of-type   {
position: fixed!important;
width: 100%!important;
bottom: 0!important;
z-index: 99!important 
}
}

 

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

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.