It seems that the width of select
element and input
element are equal. How can I make it so that input
element would take much more space and select
would take less space?
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group mb-3">
<div class="input-group-prepend">
<button class="btn btn-outline-secondary" type="button">Button</button>
</div>
<select class="custom-select" id="inputGroupSelect03">
<option selected>Choose...</option>
<option value="1">One</option>
</select>
<input class="form-control">
</div>
Set the heights of input elements using classes like . input-lg and . input-sm . Set the widths of elements using grid column classes like .
Just use the 'size' property of input.
Try adding col-*
classes in the select and input:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="input-group mb-3 row">
<div class="input-group-prepend">
<button class="btn btn-outline-secondary" type="button">Button</button>
</div>
<select class="custom-select col-4" id="inputGroupSelect03">
<option selected>Choose...</option>
<option value="1">One</option>
</select>
<input class="col-8 form-control">
</div>
You need to add col-* class to your select
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group mb-3">
<div class="input-group-prepend">
<button class="btn btn-outline-secondary" type="button">Button</button>
</div>
<select class="custom-select col-3" id="inputGroupSelect03">
<option selected>Choose...</option>
<option value="1">One</option>
</select>
<input class="form-control col">
</div>
.input-group
has already.row
style so no need to give .row class. if you give.row
then it gives negative margin that doesn't need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With