I am facing an issue with resizing images inside buttons. Despite using the Bootstrap-4 class ("img-fluid"), the images are not adjusting properly when the button height or text size is altered. The image height remains unchanged. Here is a snippet of my HTML code:
<div class="order-type-buttons col-12 d-flex" aria-label="First group">
<button type="button" class="btn order-type-btn-blue col-4 d-flex justify-content-center align-items-center">
<div class="col-8 button-text">Online Pick Up</div>
<div class="col-4 span-img">
<img class="img-fluid" src="images/icon%20files/online-pickup-icon.png" alt="">
</div>
</button>
<button type="button" role="button" class="btn order-type-btn-blue col-4 d-flex justify-content-center align-items-center">
<div class="col-8 button-text">Online Take out</div>
<div class="col-4 span-img">
<img class="img-fluid" src="images/icon%20files/online-take-out-icon.png" alt="">
</div>
</button>
<button type="button" class="btn order-type-btn-blue col-4 d-flex justify-content-center align-items-center">
<div class="col-8 button-text">Pick up</div>
<div class="col-4 span-img">
<img class="img-fluid" src="images/icon%20files/pick-up-icon.png" alt="">
</div>
</button>
For context, here is some CSS code that I've implemented:
.btn{
white-space: normal;
}
.button-text{
padding-left: 0;
padding-right: 0;
}
.order-type-btn-blue{
background-color: #0082d5;
font-size:14px;
color: white;
text-transform: uppercase;
margin: 2px 2px 2px 2px;
padding-right: 0;
padding-left: 0;
}
.order-type-buttons {
padding-right: 0;
padding-left: 0;
}
.span-img{
padding-right: 0;
padding-left: 0.313em;
}
If you'd like to see how the buttons currently appear and then after changing the button height and font size, check out the links below:
Current Button Appearance: https://i.sstatic.net/WkDt6.png
New Button Appearance: https://i.sstatic.net/qgsaP.png
To get a visual representation, view this image showcasing the layout with borders: https://i.sstatic.net/lBMYq.png