【问题标题】:Show Delete Button On Right Side Of Bootstrap Row, On Hover在引导行右侧显示删除按钮,悬停
【发布时间】:2023-03-04 04:58:01
【问题描述】:

我看到了很多在容器上弹出删除按钮的示例。我想显示在 Twitter Bootstrap 行的右侧。

<div class="row">
   <div class="col-md-4">
       Content
   </div>
   <div class="col-md-4">
       Content
   </div>
   <div class="col-md-4">
       Content
   </div>
</div>

很多样本都使用容器上的相对位置;但是,我不想弄乱 .row 上现有的表格显示,那么有没有更好的方法在 twitter 引导行的弹出窗口中做到这一点?

编辑:我想在右侧显示一个按钮,在行中居中。带有以下标记的按钮:

<button ..><i class="icon-remove-sign"></i></button>

仅在悬停时显示。

【问题讨论】:

  • 你能举个例子,你到底想达到什么目的?我真的不明白你想要什么。
  • 当您将鼠标悬停在该行上时,我想在右侧显示一个按钮以提供删除选项。
  • 喜欢这个? bootply.com/jy0it9mhr2
  • 是的!这样就可以了,非常感谢。我很惊讶无法在网上找到任何东西,这正是我所需要的。再次感谢!
  • 不客气。我会做一个答案,所以你可以接受。

标签: html css twitter-bootstrap twitter-bootstrap-3


【解决方案1】:

试试下面的代码:

HTML:

<div class="row">
   <div class="col-md-4">
       Content
   </div>
   <div class="col-md-4">
       Content
   </div>
   <div class="col-md-4">
       Content
   </div>
   <div class="hover-btn">
     <button type="button" class="close" data-dismiss="alert">
        <span aria-hidden="true">×</span>
        <span class="sr-only">Close</span>
     </button>
  </div>
</div>

CSS:

.row {
    position: relative;
  }

  .hover-btn {
     position: absolute;
     right: 15px;
     display: none;
  }

  .row:hover .hover-btn {
     display: block;
  }

Working Example

【讨论】:

猜你喜欢
  • 2014-09-13
  • 1970-01-01
  • 2011-06-09
  • 1970-01-01
  • 2020-05-28
  • 2019-09-02
  • 1970-01-01
  • 2021-09-01
  • 1970-01-01
相关资源
最近更新 更多