Archived topic
Make the scroll to top align to side of page
3 replies · Started by Michael on May 18, 2021
Before I start, I just want to thank the great team at Generatepress. Great product, great support.
Yes, so I moved the back to top to the left hand side using the sample CSS in the knowledgebase. Great, maybe could be a bit bigger, but I'd rather it stuck to the side of the page on the left hand side. Or the right if I change my mind later, but I think that would look neater. Have you got some CSS that would do that?
Hi there,
sticking it to the edge of the site content container you could do this:
/* Stick to LHS */
@media(min-width: 1300px) {
.generate-back-to-top, .generate-back-to-top:visited {
left: calc((100vw - 1200px)/2 - 50px);
}
}
OR
/* Stick to RHS */
@media (min-width: 1300px) {
.generate-back-to-top, .generate-back-to-top:visited {
left: unset;
right: calc((100vw - 1200px)/2 - 50px);
}
}
This considers a min-width of the page, so before that CSS you would add your current CSS for the positioning on smaller screens.... it must come before the above.
Wonderful, thanks so much David. Had to tweak to 99vw but really appreciated. I think it looks so much neater now.
Awesome - glad to be of help