I have a button I need to position at the bottom of the page in the right side.
https://jsfiddle.net/zuk80g6L/
button {
position: fixed;
right: 16px;
bottom: 16px;
}
That button should move further into the screen (like right: 24px
if we assume the scrollbar is 8px wide), when the scrollbar is visible. Right now it just pretty much says the total view is 1920 pixels wide. The button should always be 16 pixels from the right side
.
I need to take this into account:
- Is the scrollbar visible
- What's the width of the scrollbar
- What if there is a scrollbar, but it isn't changing the site (like on a phone)
- It has to be fixed
Basically if there is a scrollbar, move the button further left onto the site.
How is something like that possible? Thanks