2014-09-26 60 views
-1

这里是我的HTML表单:将按钮(外部<form>)与输入字段放在同一行上?

<form novalidate class="simple-form"> 
    <label ng-hide="tab==1">Reviews Min: <input type="number" ng-init="revNum=30" class="form-control review-input" min="0" step="10" ng-model="filterValues.revNum" /></label> 
    <label>Min Price &#163;: <input type="number" ng-init="filterValues.minNum=0" class="form-control price-input" min="0" step="1000" ng-model="filterValues.minNum" /></label> 
    <label>Max Price &#163;: <input type="number" ng-init="filterValues.maxNum=0" class="form-control price-input" min="0" step="1000" ng-model="filterValues.maxNum" /></label> 
    <label><select class="form-control" ng-model="filterValues.currentCarType" style="display:block;" ng-options="key for key in carTypeObj"> 
     <option value="">Select Type</option> 
    </select></label> 
</form> 
<label><button class="btn btn-primary " style="display:block;" ng-click="resetNumArray(); resetActiveRow(); resetType()">reset</button></label> 

这里是我的CSS:

.simple-form label{ 
    margin-right: 10px !important; 
} 

.simple-form button{ 
    background-color: #31708f; 
} 

.price-input { 
    width: 150px !important; 
} 
.review-input{ 
    width: 100px !important; 
} 

这里是镀铬的输出:

enter image description here

这里是在Firefox中的输出:

enter image description here

所以我的重置按钮低于我的输入字段并选择,我需要它在同一行。但如果我在<form>内移动它,当我在输入字段中写入一些值并按下Enter时,我的输入字段将被重置。
也如你所见,firefox没有正确显示我的<select>

我该如何解决这些问题?

这里是两个浏览器的预期输出:

enter image description here

注:我使用的引导。
JSFiddle

+0

的jsfiddle的底部没有bootstap – 2014-09-26 12:57:13

+1

可以在小提琴添加一个外部资源。 Firefox的'最低价格'在哪里? – putvande 2014-09-26 12:57:36

+0

小提琴http://jsfiddle.net/aqkgmah0/1/ – loveNoHate 2014-09-26 13:01:25

回答

1

而在http://jsfiddle.net/dsqc10du/6/

另一实施垂直对齐选择的形式

.simple-form{ 
    display: inline-block; 
} 
.simple-form label{ 
    vertical-align: bottom; 
} 

button{ 
    vertical-align: top !important; 
    margin-top: 20px !important; 
} 
+0

谢谢,这是最好的 – 2014-09-26 14:11:13

相关问题