I use Bootstrap 5 and I tried to place a select and 2 buttons on the same line (select should be in center, one button on the right side of the select, and another button on the left side), but I didn't succeed two things
- get the same distance between select and buttons
- get the same distance between buttons and div end.
As in the image: select should have most of the space from line, buttons should not touch the select, buttons should not touch the div end. The problem is about the distance between buttons and select and the distance between buttons and div end.
Please see the image. (the problems can be seen more clearly on small screens)
HTML: (I don't use other CSS file)
<div class="row mt-3 mb-2 text-center">
<div class="col-2">
<button class="btn btn-success">Prev</button>
</div>
<div class="col-8">
<select class="form-select" aria-label="Default select example">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</div>
<div class="col-2">
<button class="btn btn-success">Next</button>
</div>
</div>
Note: the border ins't included in html, I added that border with Paint editor just for a better view of the situation.
