Help with User Story #9: The img element should be centered within its parent element

Tell us what’s happening:
I cannot seem to get the img element to be centered with its parents element. I have tried the text-align : center with my div class but that only seems to center all of the text and not the img. I though images were inline elements and centered with text?
Any help would be really appreciated
Thank you!

Your code so far
CSS:
#image {
max-width: 100%;
height: auto;
display: block;
}

div{
  text-align: center;

}

HTML:

Dr. Norman Borlaug
Dr. Borlaug 1928 Dr. Norman Borlaug 1914 - 2009

Here is a timeline of Dr. Norman Borlaug's life:

  • 1914 - Born in Cresco, Iowa
  • 1933 - Leaves his family's farm to attend the University of Minnesota, thanks to a Depression era program known as the "National Youth Administration"
  • 1935 - Has to stop school and save up more money. Works in the Civilian Conservation Corps, helping starving Americans. "I saw how food changed them", he said. "All of this left scars on me."
  • 2009 - Dies
  • If you have time, you should read more about him on his Wikipedia Entry

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36

Challenge: Build a Tribute Page

Link to the challenge:

If you are using codepen, go ahead and post the link here, To make it easier for people to help you.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.