I divided my .grid
element in 4 column and 4 row using CSS grids. I adjusted the image so that it would be in the 1st column and the 4th row. But, as you can see, the image of a man exceeds the original height of .grid
<div>
and it overlaps and goes over another element below it.
How do I keep the image in the original size of .grid
and align it to the 1st column and 4th row? (I also want it to stick to the top of that black element, but not overlap it).
.grid {
height: 1000px;
width: 100%;
display: grid;
grid-template-columns: 25% 25% 25% 25%;
grid-template-rows: 25% 25% 25% 25%;
}
#image {
grid-column: 1;
grid-row: 4;
}
.box {
background: black;
height: 500px;
}
<div class="grid">
<div id="image">
<img src="https://futhead.cursecdn.com/static/img/14/players/176619.png"/>
</div>
</div>
<div class="box"></div>