My page is 2x the height of the screen (size varies depending on other item on the page). I want to show an absolutely positioned SPAN in the middle of the screen regardless of scroll position.
I apply the following style on button click, however if I scroll all the way down, the element shows up at the very top of the page since it counts the 50% from the top of the entire page.
.Centered {
width: 100%;
position: absolute;
top: 50%;
left: 45%;
}
How do I position the element in the middle of the page based on the scroll potion at the time of a button click?
Thank you.