how to give center in img code example
Example 1: align image to the center of the screen
.centered {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Example 2: html center image
/* It's better practice to do this in CSS, not HTML.
So here is the CSS code! */
img {
display: block;
margin-left: auto;
margin-right: auto;
}