how can I add input and button to be on the same line using bootstrap-5
, what I’m trying here it is not working, is there anyway to style it or add some bootstrap-5
markup?
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-6">
<form action="" method="get">
<input type="text" name="search_query" class="form-control">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</form>
</div>
</div>
</div>
4
Answers
You can try with splitting them into columns, by adding class
row
toform
and div’s with classcol-auto
Use Bootstrap’s input groups:
You can follow this simple code and add here some bootstrap 5 class
Flexbox.