Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Cannot move the Back-to-Top button with CSS?

  • I need to move my scroll to top to the left of the screen. I enabled it in Customizer. However, it seems I cannot control the position using my Simple CSS. It now stays on the right where I just added another icon which now covers the said button. Hence why I want to move it.

    What am I overlooking?

    Thanks for your support!

    My site: execfrontline.com

    My CSS:

    .go-to-top {
    cursor: pointer;
    }

    /* If you want the icon to appear only when the user scrolls down: */

    document.addEventListener(“scroll”, function () {
    const scrollTopIcon = document.querySelector(“.go-to-top-container”);
    if (window.scrollY > 300) {
    scrollTopIcon.style.display = “block”;
    } else {
    scrollTopIcon.style.display = “none”;
    }
    });

    /* Up to top container: */

    .generate-back-to-top,
    .generate-back-to-top:visited {
    bottom: 30px; /* from the bottom of your screen */
    left: 30px; /* from the left of your screen */
    }

    add_filter( ‘generate_back_to_top_scroll_speed’, ‘tu_back_to_top_scroll_speed’ );
    function tu_back_to_top_scroll_speed() {
    return 400; // milliseconds
    }

  • Hi there,

    You are mixing CSS, JS, and PHP in your code, so please remove all of them.

    And here’s the correct CSS to change its position:

    a.generate-back-to-top {
        left: 30px;
    }
  • Yep, thanks and resolved! Not sure where I got the code from. I hope not ChatGPT :).

    NP

  • You are welcome   🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.