I'm looking for something that:
Has a button on the right side, not just beside the input.
The current setup involves using an unattractive width: 138%
, which doesn't consistently work across different browsers and devices. The button ends up at the bottom instead of in the desired location.
Directly placing the button on the right side box is problematic as it never aligns correctly vertically. Any alternative ways I've tried make the button non-functional.
I am utilizing bootstrap 5 and would prefer to avoid using JavaScript (as in this example, I haven't included any JS).
.full-width {
width: 100%;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2e4c41415a5d5a5c4f5e6e1b001d001e034f425e464f1c">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4a2825253e393e382b3a0a7f6479647a672b263a222b78">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-qKXV1j0HvMUeCBQ+QVp7JcfGl760yU08IQ+GpUo5hlbpg51QRiuqHAJz8+BrxE/N" crossorigin="anonymous"></script>
<div class="row">
<div class="col-3">
Left part
</div>
<div class="col-6">
<label>Input 1</label>
<input type="text" class="form-control full-width">
<label>Input 2</label>
<input type="text" class="form-control full-width">
<label>Input 3</label>
<input type="text" class="form-control full-width">
<div class="row" style="width: 138%;">
<div class="col-9">
<label for="sim">Special input</label>
<input class="full-width form-control" type="text" name="sim">
</div>
<div class="col-3">
<button type="button" class="btn btn-danger my-4">One button</button>
</div>
</div>
</div>
<div class="col-3">
Right part
</div>
</div>
Is there a way to resolve this issue?