内联3个元素

时间:2018-09-26 14:35:59

标签: html css

我想要一个包含3个元素的内联表单,
标签选择输入
让我向您展示图像,第一个是我现在得到的,第二个是我想要实现的

enter image description here

<div class="col-sm-12">
    <div class="input-group input-group-sm form-inline panel">
        <span class="input-group-addon">Ulica</span>
        <select ng-model="model.streetType" class="form-control" ng-options="value for (key, value) in streetTypeMap" style="width: 10%;">
                <option style="display:none"/>
            </select> 
        <input type="text" ng-model="model.street" class="form-control" placeholder="Ulica"> </input>
    </div>
</div>

有什么办法解决该问题吗?

编辑# 添加CSS

.input-group{width: 100%;}
.input-group-addon{width: 220px !important;}

1 个答案:

答案 0 :(得分:0)

尝试通过此类指定大小:

<div class="col-sm-12">
    <div class="input-group input-group-sm form-inline panel">
        <span class="input-group-addon col-sm-4">Ulica</span>
        <select ng-model="model.streetType" class="form-control col-sm-2" ng-options="value for (key, value) in streetTypeMap" style="width: 10%;">
            <option style="display:none"/>
        </select> 
        <input type="text" ng-model="model.street" class="form-control col-sm-6" placeholder="Ulica"> </input>
    </div>
</div>