垂直对齐下拉列表和输入按钮

时间:2016-03-23 21:53:48

标签: html

我有两个按钮,一个下拉列表和一个我想垂直对齐的文本输入。它们几乎没有偏离1像素,但它们已经关闭,这让我疯狂。

请参阅以下代码:

<div style="text-align:center;padding-top:85px">

            <form role="form" class="form-inline ">
                <div class="form-group">
                    <select class="form-control selectWidth" style="width:auto">
                        <option> Primary Care Physician </option>
                        <option> Dermatologist </option>
                        <option> Orthodontist </option>
                    </select>       
                </div>
                <input type="text" class="form-control" placeholder="Enter Zip Code"> 
            </form>

</div>

1 个答案:

答案 0 :(得分:0)

HTML:

<div ng-repeat="param" class="test row">
    <div class="col-sm-4">
        <select class="form-control">
          <option> Primary Care Physician </option>
          <option> Dermatologist </option>
          <option> Orthodontist </option>
        </select>
    </div>
    <div class="col-sm-8">
    <input type="url" class="form-control col-sm-8 invalidInput" placeholder="Enter Zip Code">
    </div>
</div>

CSS:

.test{
  width:50%;
}

See JsFiddle