css - Bootstrap div,右侧带有响应按钮

标签 css twitter-bootstrap

在 Bootstrap 中遇到了一个问题,关于如何拥有一个像 div 这样的输入组,其中包含一些内容并在右侧有一个响应按钮。我希望按钮始终位于右侧,这也是响应式的。我尝试使用下面的代码,但似乎这不是正确的代码。请看下面的演示。

.btn-custom {
  position: absolute;
  right: 5px;
  height: 100%;
  min-height: 100px;
  top: -9px;
  border-top-left-radius: 0px;
  border-bottom-left-radius: 0px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>


<div class="container">
  <div class="row">
  <div class="col-md-6">
    <div class="well well-sm">
      <div class="row">
        <div class="col-xs-4">
          <img src="http://placehold.it/350x350" class="img-responsive img-circle" />
        </div>
        <div class="col-xs-4">
          Lorem ipsum dolor sit.
        </div>
        <div class="col-xs-4 text-right">
          <a href="" class="btn btn-primary btn-custom">Go!</a>
        </div>
      </div>
    </div>
  </div>
</div>
</div>

我不想要下面这样的东西。 enter image description here

最佳答案

你试过pull-right吗?

<div class="col-xs-4 text-right">
   <a href="" class="btn btn-primary btn-custom">Go!</a>
</div>

关于css - Bootstrap div,右侧带有响应按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44020822/

相关文章:

css - 从 ericportis.com (srcset-sizes) 了解断点计算

javascript - 为什么在滚动元素中使用 offset().top 和 scrollTop() 时我的尺寸没有按预期返回?

html - 将 <td> 中的文本输入与 twitter bootstrap 中的右侧对齐?

html - 水平对齐 HTML 表头中的元素

css - 面板 div 中的多个面板主体

javascript - iframe 如何获得其父背景颜色?

html - 我的文本区域不接受任何宽度属性

html - 如何让中继器填满屏幕的宽度?

javascript - 模态中出现奇怪的符号而不是内容

javascript - 使用百分比调整 div 大小时 Mapquest 窗口不显示