html - 如何在同一行对齐 div 输入标签和按钮

标签 html css

我是 html 新手,我有一个 code我想在同一行上将输入标签和右标志上的按钮对齐。我该怎么做?

  <div class="form-group input-group">
    <input type="text" class="form-control" />
    <span class="input-group-btn input-group-addon">
        <button class="btn btn-del input-group-delete" data-tooltip="tooltip" ><i class="fa fa-trash-o"></i></button>
    </span>
  </div>

我的 jsfiddle:https://jsfiddle.net/DTcHh/17952/

最佳答案

你也可以这样做...

<style>
.nopadding{
  padding:0;
}
</style>
<div class="timeline-panel">
  <div class="timeline-heading">
    <div class="form-horizontal col-xs-12">
      <div class="form-group input-group">
        <input type="text" class="form-control" />
        <span class="input-group-btn input-group-addon nopadding">
                            <button class="btn btn-del input-group-delete" data-tooltip="tooltip" ><i class="fa fa-trash-o"></i></button>
                </span>
      </div>
    </div>
  </div>
</div>

关于html - 如何在同一行对齐 div 输入标签和按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35864006/

相关文章:

javascript - 我如何使用 css 和 javascript 更改两个选定元素的颜色

css - 使用通用 CSS 类进行 Bootstrap 3 设置

html - 简单的 2 block 移动导航

css - Pagedown Markdown 编辑器 : issue with images

html - 为什么我的 img 显示和 CSS 不适用?

html - 如何在 anchor 链接中写入 url,这样就不会触发错误/警告@ w3c 验证器

html - CSS 动画在 Firefox 浏览器上创建闪烁

html - 弹出转换时隐藏滚动条

html - 可以在运行时添加到无序列表

php - 使用 PHP 逻辑内联 HTML 背景图像?