Currently, I am in the process of developing a form that includes multiple input fields. To organize these fields, I have utilized the Bootstrap 4 Grid system. However, I am encountering challenges when it comes to aligning certain input fields.
Snippet
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
<form>
<div class="container" style="border: 2px solid gray">
<br>
<div class="row container">
<label class="col-lg-2 text-primary">Company Id :</label> <input type="text" class="col-lg-3 form-control" disabled="disabled">
<label for="usr" class="col-lg-2 text-primary ">Company Name
:</label> <input type="text" class="col-lg-3 form-control " disabled="disabled">
</div>
<hr style="border: 1px solid gray">
<div class="row container">
<div class="input-group mt">
<label for="usr" class="col-lg-2 text-primary ">Item Code :</label>
<div class="dropdown-menu ">
<a class="dropdown-item" href="#">Link 1</a> <a class="dropdown-item" href="#">Link 2</a> <a class="dropdown-item" href="#">Link 3</a>
</div>
<input type="text" class="form-control col-lg-3 ">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown"></button>
<label for="usr" class="col-lg-2 text-primary ">Item Name :</label>
<input type="text" class="col-lg-3 form-control ">
</div>
</div>
<div class="row container">
<div class="input-group mt-3">
<label for="usr" class="col-lg-2 text-primary ">Brand Code:</label>
<div class="dropdown-menu ">
<a class="dropdown-item" href="#">Link 1</a> <a class="dropdown-item" href="#">Link 2</a> <a class="dropdown-item" href="#">Link 3</a>
</div>
<input type="text" class="form-control col-lg-3 ">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown"></button>
<label for="usr" class="col-lg-2 text-primary ">Brand Name:</label>
<input type="text" class="col-lg-3 form-control ">
</div>
</div>
<div class="row container">
<div class="input-group mt-3">
<label for="usr" class="col-lg-2 text-primary ">Category Code:</label>
<div class="dropdown-menu ">
<a class="dropdown-item" href="#">Link 1</a> <a class="dropdown-item" href="#">Link 2</a> <a class="dropdown-item" href="#">Link 3</a>
</div>
<input type="text" class="form-control col-lg-3 ">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown"></button>
<label for="usr" class="col-lg-2 text-primary ">Category Name:</label>
<input type="text" class="col-lg-3 form-control ">
</div>
</div>
<div class="row container">
<div class="input-group mt-3">
<label class="col-lg-2 text-primary">Cost Price :</label> <input type="text" class="col-lg-3 form-control">
<label for="usr" class="col-lg-2 text-primary ">Selling Price
:</label> <input type="text" class="col-lg-3 form-control ">
</div>
</div>
<br>
</div>
</form>
On smaller screens, the alignment appears flawless, but on larger screens, the fields do not line up properly.
My goal is to achieve a design similar to this:
https://i.sstatic.net/lbbGR.png
While enhancing the visual appeal with Bootstrap 4, my primary focus is to ensure proper field alignment across different devices.