Cannot get image to center within DIV

Cannot get image to center within DIV
0

#1

Hi. I’m trying to work on the first project…the tribute page. I want to put an image inside of a DIV that has a white background, but I can’t get the image inside of the DIV to be centered inside of the DIV. Here is the link to the page I’m working on in CodePen. Can someone please help me?

Thank you!

p.s. - Do I need to paste the code here, or can you see my code on CodePen? Thanks.


#2

All you had to do was add the text-center command in the inside div.

  <img  src="http://2.bp.blogspot.com/-YaYNHvO0Qp8/WRKBN1hGnkI/AAAAAAAABps/VYwm1MQFb8YBFHg5C9R4Yls6ZH4h8C9uACK4B/s1600/prison%2Bbreak%2Breturns%2Bto%2Btv%2Bnew%2Bepisodes.jpg" alt="Prison Break">
  </div>

#3

Ah. Thanks so much. I kept trying to add it inside of the IMG element. :confused: I’ll be sure to remember that from now on. Thanks again.


#4

That applies to any special elements you run into in the future eg. button, form, link … Great app though