vertical and horizontal center image in div 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: css align center
.center {
margin: auto;
width: 50%;
border: 3px solid green;
padding: 10px;
}