Я пытаюсь создать поле формы с 4 кнопками в одной строке. Я использую Bootstrap, и так как я хотел, чтобы поле и кнопки были выровнены по вертикали, я сделал для него класс css vcenter
.Бутстрап столбца не переходит к следующей строке на маленьком экране
JSfiddle с кодом
HTML
<form>
<div class="row stopWrap">
<div class="form-group col-lg-8 col-md-8 col-sm-8 col-xs-12 vcenter">
<label for="inputFirstName">First Name</label>
<input type="email" class="form-control" id="inputFirstName" placeholder="First Name">
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 text-center vcenter">
<button type="button" class="btn btn-warning" aria-label="Left Align">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-primary" aria-label="Left Align">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-danger" aria-label="Left Align">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-success" aria-label="Left Align">
<span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
</button>
</div>
</div>
</form>
CSS
.stopWrap{
white-space: nowrap;
}
.vcenter {
display: inline-block;
vertical-align: middle;
float: none;
}
Какое желаемое поведение уменьшает размер экрана? Вы хотите, чтобы поле «first name» стало меньше, а кнопки остались рядом с ним, или вы хотите, чтобы кнопки переходили к следующей строке или? – gibberish
@gibberish Я хочу, чтобы кнопки прыгали до следующей строки. Я использовал 'col-xs-12', но он не работает – anonn023432
это то, что вы ожидали: http://jsfiddle.net/v9ec3/857/ –