css cover img center code example
Example 1: css image fit in div with aspect ratio
img {
width: 100%;
height: 100%;
object-fit: contain;
}
Example 2: css background image cover
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}