Jump to content

Scroll to Top Button I added on footer, appears in another section

Go to solution Solved by tuanphan,

Recommended Posts

Posted (edited)

Site URL: https://www.compatiblewithlove.org/

@tuanphan I inserted your scroll to top button on my footer using this HTML code:

<a href="#top" class="t-top"><span class="arrow"></span>Top</a>

And this CSS Code:

/* Back to Top */
.t-top {
    font-weight: 300;
    letter-spacing: 3px;
    font-size: 15px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.6;
    padding-left: 2px;
    padding-top: 4px;
    position: fixed;
    right: 0px;
    bottom: 100px;
    width: 40px;
    height: 40px;
    z-index: 999;
    background-color: transparent;
    color: #000;
}
.t-top .arrow:before {
      font-family: 'squarespace-ui-font';
    font-style: normal;
    font-weight: 300;
    font-size: 20px;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    content: "\e02d";
    text-align: center;
    display: block;
    vertical-align: middle;
    transform: rotate(-90deg);
    cursor: pointer;
    margin-left: -4px;
}
.t-top .arrow {display:inline;}

/* align center back to top */
a.t-top {
    text-align: center;
    display: block;
    width: 100%;

 

It works great on my footer and is exactly the look and placement I wanted. But I noticed that it was appearing in the second section of the homepage (the light blue section) as well, but wasn't clickable. I only want it to show on my footer. Any idea what is making it appear at the top of the page and only in the second section as well?

Screenshot 2024-10-01 151520.png

Edited by LexM
  • Replies 3
  • Views 495
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted

It looks like it only appears once I have clicked on the button. Any ideas on why this is happening?

  • Solution
Posted
On 10/2/2024 at 8:56 PM, LexM said:

It looks like it only appears once I have clicked on the button. Any ideas on why this is happening?

You can change

position: fixed;

to

position: absolute;

or 

add this extra to Custom CSS

#page article section {
    position: relative;
    z-index: 99999999999 !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.