I am attempting to create a row with two columns; one is col-7 and the other is col-5. In col-, I am adding a form where I encountered an issue with col-7 as I tried to insert a png using an image tag. My goal is to center the image both vertically and horizontally inside col-5, but my attempts with mx-auto and my-auto have been unsuccessful.
https://i.sstatic.net/HypZo.png
Here is the link to the CodePen
.rect {
background-color: red;
}
.container {
border: 5px solid #000;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css">
<div class="container">
<div class="row">
<div class="col-7 mx-auto"><img src="https://i.ibb.co/LC6Wchz/cover-image.png" class="" alt=""></div>
<div class="col-5 rect"></div></div></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
Visit neramclasses.com for more information