I have a parent div with three nested divs structured like this:
.button-class {
margin-top: 0.5rem;
margin-right: 0.5rem;
margin-left: 45rem;
}
.svg-class {
margin-top: 1rem;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="42202d2d36313630233202766c74">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
<div class="d-flex mb-3">
<div class="mr-auto p-2">
<h2>text</h2>
</div>
<div class="button-class p-2">
<ion-button></ion-button>
</div>
<div class="svg-class p-2">
<svg></svg> //code
</div>
</div>
The issue I'm facing is in aligning the elements in a specific way. I want a text on the left, and a button along with an info symbol on the right. On mobile, I want the text and the button + info symbol to stack vertically. However, my current implementation is causing them to display side by side even on mobile screens.
Despite trying various bootstrap classes and CSS flexbox properties, I'm unable to achieve the desired layout for both larger and smaller screens.
https://i.sstatic.net/qMWTM.jpg
Any help or suggestions on achieving this layout would be greatly appreciated. I have experimented with different approaches but cannot seem to find a solution that works well for all screen sizes.
EDIT:
One approach I tried was using CSS flexbox with flex-grow properties for the child elements. However, I encountered issues in styling the SVG element independently. Any insights or advice on resolving this styling problem would be valuable.