I'm trying to understand the functionality behind this code snippet. Can anyone shed some light on it?
img{
display:block;
margin:auto;
}
I attempted to center a gif using this code block after my teacher suggested trying align:center; without success. I searched online for the solution, but couldn't grasp the concept fully. I know that margin is used to create space between elements, backgrounds, or borders. However, the use of 'auto' in this context is perplexing to me. Any insights would be appreciated. Thank you.