Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a button stay at a bottom of a screen?

I've got a button that I want to stay at the bottom of the screen, no matter how you scroll the page up or down the page. I need it to stay a fixed distance away from the bottom of the window.

How do I make it sticky like this?

like image 501
Mo-Alanteh Avatar asked May 04 '15 09:05

Mo-Alanteh


3 Answers

To keep any element fixed on page irrelevantto scroll you need to make it position fixed

Please check below CSS

button {
    position: fixed;
    bottom: 0;
    right: 0;
}
like image 123
Nilesh Mahajan Avatar answered Oct 12 '22 19:10

Nilesh Mahajan


CSS

button {
  position: fixed;
  bottom: 10px;
  right: 10px;
}

something like that.

like image 1
braks Avatar answered Oct 12 '22 19:10

braks


just add below css:

button{
    position:fixed;
    left:10px;
    bottom:10px;
}
like image 1
Super User Avatar answered Oct 12 '22 19:10

Super User