I'm attempting to center an image above a div container. below is my HTML code.
<div class="main-container">
<img class="ipl-img" src="assets/img/Indian_Premier_League_Official_Logo.svg.png">
<div class="center">
</div>
</div>
Here is the css
.center {
margin-top: 20px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
width: 90%;
padding: 10px;
height: 400px;
border-radius: 25px;
box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
background-color: rgb(255, 255, 255);
}
.ipl-img {
padding-right: 30px;
padding-top: 90px;
margin: auto;
width: 50%;
position: absolute;
left: 0px;
top: 0px;
z-index: 1;
}
Even though i have used margin auto i cannot seem to get the image centered. How can i get it centred?