I want to center the login-img2 vertically and horizontally using flexbox but with this code the image is vertically center but horizontally is not center if i remove flex from grand parent div then its horizontally center but vertically not. I want the minimum flex code to center the image both horizontally and vertically
.login-img-section {
background-image: url('../images/login-img1.png');
height: 663px;
/* max-width: 40%; */
}
.login-img2 {
align-items: center;
display: flex;
justify-content: center;
}
<section>
<div class="container-fluid login-page-wrapper p0">
<div class="row">
<div class="col-lg-6 col-md-12 login-img-section">
<div class="login-img2">
<img src="./src/images/login-img2.png" />
</div>
</div>
<div class="col-6"></div>
</div>
</div>
</section>