how to center a picture in a div css code example
Example 1: image center in div
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 40%;
}
Example 2: css for displaying image center
text-align: center;
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 40%;
}
text-align: center;