css - 使用 Bootstrap 3 创建最小的输入字段和按钮

标签 css twitter-bootstrap-3

我正在尝试使用字形按钮创建一个非常小的输入字段。

不幸的是,即使我已经清除了所有内容,仍有白色边框。

HTML:

<div class="input-group input-group-lg">
  <input type="text" class="form-control transp" placeholder="Search">
  <span class="input-group-btn">
    <button class="transp btn btn-default " type="button"><i class="glyphicon glyphicon-search"></i></button>
  </span>
</div>

CSS:

.transp {
            background:none!important;
            background-color: rgba(255,255,255,0.8)!important;
            border:none!important;
            border-color:none!important;
            text-shadow:none!important;
            box-shadow:none!important;
        }

请参阅此 Bootply 示例作为白色按钮边框的演示:

Bootply - Button Border

最佳答案

.input-group-btn:last-child>.btn 上的边距是原因。

将其添加到您的 CSS 中:

.input-group-btn:last-child>.transp {
    margin-left: 0;
}

关于css - 使用 Bootstrap 3 创建最小的输入字段和按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28282047/

相关文章:

html - 在进度条前后追加文字

html - 不允许元素破坏 bootstrap 3

reactjs - 如何在 React-Bootstrap 组件中将 padding/margin 作为 props 传递

html - 如何让输入字段和按钮填充 Bootstrap 表单中的整行?

html - CSS 延迟 :active selector taking effect

html - Rails 应用程序的基础顶部栏导航

css - 没有使用 Bootstrap for Angular 渲染的样式

html - 如何删除数据表 Bootstrap 的垂直滚动?

javascript - 单击时将类 "active"应用于导航链接?

javascript - 带有上一个和下一个箭头的 Bootstrap 旋转木马图像指示器