【问题标题】:Position of Back button always right and down of a page后退按钮的位置始终位于页面的右侧和下方
【发布时间】:2022-01-04 08:08:11
【问题描述】:

有没有办法在html/css 中放置一个按钮,以便始终将按钮放在页面的最右下角?不得不提的是,页面中存在的表将会有更多的行,因为:如果用户添加一条记录,该记录将显示在视图中。

我已经尝试过并且正在工作的是为按钮“返回”制作一个 div:

button[name=BackBtn] {
  color: white;
  padding: 8px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
}
<div class="Back">
  <button name="BackBtn" type="button" style="font-size: 16px; float: right; border-radius: 8px;  background-color: #3869d4;" onclick="history.back()">Πίσω</button>
</div>

【问题讨论】:

  • 试试position: fixed
  • 谢谢@kiner_shah。我会试试你推荐的。

标签: html css button display


【解决方案1】:

如果您想滚动并让按钮始终位于相对于视口的那个位置,您必须使用 position:fixed,这样无论您身在何处在页面中,您会看到按钮总是在同一个地方。如果您希望始终将其固定在页面的右下角而不是在视口中(如果向上滚动可能看不到它),您可以使用 position right and bottom(以像素为单位)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-22
    • 2022-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多