Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixed position CSS for a button to provide website feedback

I want to create a fixed position button that will run on my site, either on the left hand side or as a popout panel (see http://uservoice.com/fullservice for a cool popout button at the bottom of the screen). Clicking on the button will launch a popup window that my company uses for contact and feedback information.

Is there a basic example CSS for these types of buttons? I am a JS guy and created the popup window with no problems, but I don't have the CSS skills to get the button to activate my window.

like image 736
Wilson Tomer Avatar asked Mar 11 '11 18:03

Wilson Tomer


People also ask

How do I fix a button position in CSS?

If you want the button fixed at the lower right bottom, you can use position: absolute instead of fixed. It dissapear after scrolling down. Okay, if your container height is dynamic then try to use position: sticky or relative.


2 Answers

the css would be:

.button {
    position: fixed;
    bottom: 0;
    right: 0; //or left: 0; depending on where you want it to be.
}

with html being:

<div class='button'> button text here </div>
like image 137
Naftali Avatar answered Oct 06 '22 01:10

Naftali


Try something like this:

#feedback-button {
  position: fixed;
  bottom: 0px;
  right: 0px;
}
like image 37
Groovetrain Avatar answered Oct 06 '22 00:10

Groovetrain