如何将按钮的样式设置在屏幕底部

时间:2019-04-04 18:34:07

标签: css

保证金:底部;无法正常工作,我需要一种替代方法,可以向下移动屏幕上的所有按钮。我正在做一个hang子手游戏,我需要把我的话猜猜放在按钮上方。当按钮位于顶部时,我无法执行此操作。我需要帮助才能找到可以向下移动按钮的css命令!非常感谢!

已尝试保证金:底部;和垂直对齐,但都没有用...不知道为什么

/*these create my 26 alphabet buttons, and are essentially the thing I need to move downwards. */
for (var i = 0; i < 26; i++){
   var etl = document.createElement("BUTTON");
   var let = String.fromCharCode(97+i);
   var tee = document.createTextNode(let);
   etl.appendChild(tee);
   document.body.appendChild(etl);
}

/* my css so far used to style my buttons along with my failed attempt to lower the buttons */

BUTTON { 
    margin: bottom;
    height: 50px;
    width: 50px;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 9pt;
    outline: none;
    width: 50px;
    border-radius: 50%;
    cursor: pointer;
    text-align: center;
    color: black;
    background-color: white;
    margin: 5px;
    font-family: "HelveticaNeue-UltraLight", "Helvetica Ultra Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

我希望按钮位于页面底部,但它们仍位于页面顶部。

2 个答案:

答案 0 :(得分:1)

您需要将位置设置为固定,

位置:固定;        底部:0%;

更新
JS:

library(plotly)
library(ggplot2)
data <- poolfinderdata1()
data[[input$Col]] <- as.factor(data[[input$Col]]) # so the color is mapped as discrete
data$Matcher <- as.factor(data$Matcher) # same for the markers
p <- ggplot(data, aes_string(x = input$X, y = input$Y, color = input$Col)) +
     geom_point(aes(shape = Matcher)) +
     geom_smooth(method = "loess")
ggplotly(p)

CSS:

var div = document.createElement("DIV")
for (var i = 0; i < 26; i++){
  var btn = document.createElement("BUTTON");

   var let = String.fromCharCode(97+i);
   var tee = document.createTextNode(let);
   btn.appendChild(tee);
  btn.className = "buttonStyle";
  div.appendChild(btn);
  }
  document.body.appendChild(div);

答案 1 :(得分:0)

您可以将位置设置为absolute

button {
    position: absolute;
    bottom: 0;
....
    }