I'm attempting to achieve a specific layout that includes images scaling across Bootstrap breakpoints and a static button position. The challenge is maintaining the layout as depicted in the mockup, regardless of image size.
- The images are set to
img-fluid
for responsiveness. - The button does not need to scale and should remain fixed in its position.
Despite trying various methods like using absolute positioning for the button within the first column, I couldn't achieve the desired outcome.
I am open to alternative approaches as long as the content remains within a single row
. This is just one of my attempts.
Here are some of my attempted solutions:
Initial layout without the button
:
<div class="row py-3">
<div class="col">
<img src="https://fakeimg.pl/693x678" class="img-fluid">
</div>
<div class="col">
<img src="https://fakeimg.pl/693x678" class="img-fluid">
</div>
</div>
Attempt 1:
<div class="row py-3">
<div style="position: absolute" class="text-center h-auto" style="position: absolute; left: 0; right: 0;">
<a class="btn btn-success text-white px-5">Hi guys</a>
</div>
<div class="col">
<div class="w-100">
<img src="https://fakeimg.pl/693x678" class="img-fluid mr-3">
<img src="https://fakeimg.pl/693x678" class="img-fluid ml-3">
</div>
</div>
</div>
Attempt 2:
<div class="row py-3">
<div class="col">
<a class="btn btn-success text-white px-5" style="position: absolute; left: 0; right: 0;">Hi guys</a>
<img src="https://fakeimg.pl/693x678" class="img-fluid">
</div>
<div class="col">
<img src="https://fakeimg.pl/693x678" class="img-fluid">
</div>
</div>
Various other attempts were made...