I am struggling with my inline Bootstrap 5 form that includes a collapsible menu for advanced search. The issue I'm facing is that when I open the advanced search menu, it pushes down box 1 and 2 instead of neatly expanding below. I tried setting the .collapse class to position absolute, but then the layout gets messed up – the dropdown menu doesn't stretch to 100% width and box 1 and 2 sort of jump around when clicking on the advanced search. Viewing the snippet in full-page mode makes the problem more evident. Any assistance in resolving this would be greatly appreciated. I've been stuck on this form conundrum for quite some time!
.collapse{
position: absolute;
width: 1200px;
}
.search-form{
border:2px solid #000;
}
<Doctype html>
<html lang="en">
<head>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="86e4e9e9f2f5f2f4e7f6c6b3a8b6a8b4">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body>
<!--Search form-->
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-10 bg-white search-form ">
<form action="" class=" form-inline d-flex">
<div class="row g-3 align-items-center">
<div class="col-auto">
<a data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample" class="advanced">
Advance Search With Filters <i class="fa fa-angle-down"></i>
</a><div class="collapse" id="collapseExample">
<div class="card card-body">
<div class="row">
<div class="col-md-4">
<input type="text" placeholder="Property ID" class="form-control">
</div>
<div class="col-md-4">
<input type="text" class="form-control" placeholder="Search by MAP">
</div>
<div class="col-md-4">
<input type="text" class="form-control" placeholder="Search by Country">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<input type="password" id="inputPassword6" class="form-control" placeholder="box1" aria-describedby="passwordHelpInline">
</div>
<div class="col-md-3">
<input type="password" id="inputPassword6" class="form-control" placeholder="box2" aria-describedby="passwordHelpInline">
</div>
<div class="col-md-3">
<span id="passwordHelpInline" class="form-text">
Must be 8-20 characters long.
</span>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Bootstrap5 JavaScript-->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="54373b263114667a6d7a66">[email protected]</a>/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8fede0e0fbfcfbfdeeffcfbaa1bfa1bd">[email protected]</a>/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
</body>
</html>