【问题标题】:Bootstrap: How to position an element with 100% width on the bottom of a card with fixed height?Bootstrap:如何在固定高度的卡片底部放置 100% 宽度的元素?
【发布时间】:2019-02-12 08:49:11
【问题描述】:

我有一张固定高度的简单卡片。现在我想在卡片底部放置一个工具栏。工具栏需要具有卡体的全宽。但它不起作用:

<div class="card" style="height: 300px;">
  <div class="card-body">
    <div style="border: 1px solid red; width: 100%; position: absolute; bottom: 0px;">
      toolbar
    </div>
  </div>
</div>

它接缝,我的工具栏的 100% 宽度引用卡片,而不是卡片主体。如何解决这个问题?

【问题讨论】:

  • 尝试添加 left:0 和 right:0

标签: twitter-bootstrap bootstrap-4 css-position


【解决方案1】:

使用这个我希望这个工作

     <div class="card-footer text-muted"> toolbar </div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多