How to center images both vertically and horizontally on background?
I have this code:
.lineargradientgreen {
background-image: linear-gradient(green, white);
border-width: 2pt 2pt 2pt 2pt;
height: 500px;
width: 500px;
float: left;
text-align: center;
}
.lineargradientblue {
background-image: linear-gradient(to top left, white, blue);
border-width: 2pt 2pt 2pt 2pt;
height: 500px;
width: 500px;
float: left;
text-align: center;
}
<div class="lineargradientgreen">
<img src="https://www.listefit.com/wp-content/uploads/2017/12/tiny-png-google-g%C3%B6rsel-optimizasyonu.jpg" alt="Hot Air Balloon" width="200px" height="200px" />
</div>
<div class="lineargradientblue">
<img src="https://www.samcodes.co.uk/project/geometrize-haxe-web/assets/images/xseagull.jpg.pagespeed.ic.iK66EGA15-.jpg" alt="Hot Air Balloon" width="200px" height="200px" />
</div>
Finally, I got the images only horizontally centered on both backgrounds, how can I also vertically center them?