I have following HTML. I am using Twitter Bootstrap and AngularJS.
<div class="item item-custom-first">
<select class="form-control"style="display:inline; float:right" ng-model="requestdata.units.length" ng-options="value.id as value.label group by value.group for value in lengthUnits" ng-change="validateLength()">
<option value="" selected hidden />
</select>
</div>
<div class="item item-input item-stacked-label item-custom-second">
<span class="positive" ng-bind-html="translatedData.lengthField"></span>
<div class="number number" >
<input class="form-control" type="number" name="length" placeholder="Value"
ng-model="requestdata.beltSystem.length"
ng-required="true" ng-blur="validateLength()">
</div>
</div>
Since, that HTML is part of partial being used by lots of different pages, I cannot rearrange them.
I have following css.
.item-custom-first select{
width: inherit !important;
}
.item-custom-second div{
display: inline-flex !important;
width: auto !important;
}
With this I am able to display those elements as
However, I need input field to be aligned side by side with equal gap between input field and units drop-down as following.
Is there anyway, I can do that with CSS? I will be providing more info if needed. Thanks in advance.
UPDATE…
I want that text input to fill in all empty space if possible.
2
Answers
Add
font-size: 0px;
to the parent.You can add
pull-right
like this<div class="item item-input item-stacked-label item-custom-second pull-right">
then add amargin-right
to separate them all equally.see fiddle: https://jsfiddle.net/smh6bsrq/1/