Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add fixed button to the bottom right of page

I'm having some trouble adding a fixed button on the bottom of my webpage. Been testing out different numbers with the pixels, but the button hasn't been showing underneath the page on the right.

HTML

<a href="#head"><img src="upbutton.png" id="fixedbutton"></a> 

CSS

.fixedbutton {     position: fixed;     bottom: 560px;     right: 1000px;  } 
like image 930
Brian Lam Avatar asked Oct 04 '13 18:10

Brian Lam


People also ask

How do I place a fixed button at the bottom right of the screen in HTML?

On the module, find the Fixed position toggle in Design > Button > General. Once toggled on, you can pin the button at either the bottom right, bottom left or bottom center of the screen.

How do you position a button to the bottom right in CSS?

You need to use position: absolute in order for it from the bottom-right. The parent component must have the relative tag and button should have an absolute tag.

How do you move a button to the right of the page?

You can also move you button to right by applying text-align: right; to it's parent. In your case it's parent is body. Note: It make your p tag also align to right.

How do you put a button on the bottom?

Go to res (right-click) > New > Android resource file and in the pop-up menu choose the resource type to menu and name the file bottom_nav_menu. It should look like this. Inside bottom_nav_menu. xml add items that we want to show in the bottom app bar.


1 Answers

You are specifying .fixedbutton in your CSS (a class) and specifying the id on the element itself.

Change your CSS to the following, which will select the id fixedbutton

#fixedbutton {     position: fixed;     bottom: 0px;     right: 0px;  } 

Here's a jsFiddle courtesy of JoshC.

like image 177
chopper Avatar answered Sep 20 '22 07:09

chopper