how to center an image in css horizontally and vertically code example
Example 1: center an image horizontally and vertically
.center{
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
Example 2: center text in div container
text-align: center