center image in a element code example
Example 1: image center in div
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 40%;
}
Example 2: center an image
.someclass {
display: block;
margin-left: auto;
margin-right: auto;
}