I'm really new to this, I'm doing a project that is making a tribute page on Freecodecamp, so it tells me "Your #image must be centered inside its parent". I will have mistakes….however I am learning, thanks.
#img-div {
max-width: 600px;
margin: 0 auto;
padding: 15px;
background-color: #ffffff;
}
#image {
margin-top: 24px;
margin-bottom: 24px;
max-width: 100%;
height: auto;
display: block;
margin-left: 330px;
border-radius: 5px;
}
Your code would look like this, keeping the top and bottom margins:
When you specify
auto
you are basically telling the browser to automatically determine the left and right margins, within its main or "parent" container.