html - 在输入文本的同一行显示按钮

标签 html css

我正在使用来自 UI Bootstrap 的日期选择器这样:

<div class="form-group">
    <label class="col-lg-3 control-label">Birth Date:</label>
    <div class="col-lg-8">
        <input type="text"
                class="form-control"
                datepicker-popup="MMMM dd, yyyy"
                ng-model="panels.patient.birthDate"
                is-open="pdfc.opened"
                ng-required="true"
                close-text="Close" />
        <span class="input-group-btn">
            <button type="button" class="btn btn-default" ng-click="pdfc.open()"><i class="glyphicon glyphicon-calendar"></i></button>
        </span>
    </div>
</div>

按钮显示在一个新行中,就好像有一个 <br /> .有没有办法在 <input /> 的同一行显示按钮?就像它发生在 these examples

最佳答案

设置 input-group 而不是 form-group

HTML

    <label class="col-lg-3 control-label">Birth Date:</label>
    <div class="col-lg-8">
    <div class="input-group">
      <input type="text"
                class="form-control"
                datepicker-popup="MMMM dd, yyyy"
                ng-model="panels.patient.birthDate"
                is-open="pdfc.opened"
                ng-required="true"
                close-text="Close" />
      <span class="input-group-btn">
        <button type="button" class="btn btn-default" ng-click="pdfc.open()"><i class="glyphicon glyphicon-calendar"></i></button>
      </span>
    </div>

DEMO HERE

关于html - 在输入文本的同一行显示按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31535867/

相关文章:

jquery - 使用 jQuery 时,我是否被迫使用 href ="#"?

html - 制作重叠按钮

CSS className 没有对 Reactjs 做任何改变

Javascript 相关的输入按钮文本更改

html - iOS - 在 flexbox 中带有输入元素的 float 光标

html - 如何在媒体屏幕@media 上固定和居中图像(最大宽度 : 480px)

CSS 使用 100%

css - 有没有办法在 Firefox 或 Chrome 中禁用 CSS3 支持?

在特定点打破长单词的 HTML 字符

html - 移动设备上真的很奇怪的白色间隙