javascript 用于提供网站反馈的按钮的固定位置 CSS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5276993/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 16:36:35  来源:igfitidea点击:

Fixed position CSS for a button to provide website feedback

javascriptasp.nethtmlcss

提问by Wilson Tomer

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/fullservicefor 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.

我想创建一个将在我的网站上运行的固定位置按钮,无论是在左侧还是作为弹出面板(请参阅http://uservoice.com/fullservice以获取屏幕底部的一个很酷的弹出按钮)。单击该按钮将启动一个弹出窗口,我的公司将在该窗口中显示联系和反馈信息。

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.

是否有这些类型按钮的基本示例 CSS?我是一个 JS 人,并且毫无问题地创建了弹出窗口,但我没有 CSS 技能来获取按钮来激活我的窗口。

回答by Naftali aka Neal

the css would be:

css 将是:

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

with html being:

与 html 是:

<div class='button'> button text here </div>

回答by Groovetrain

Try something like this:

尝试这样的事情:

#feedback-button {
  position: fixed;
  bottom: 0px;
  right: 0px;
}