Tribute Page - Build a Tribute Page

Tell us what’s happening:

Hi everyone, please help me. I am unable to do the last step which is to center my image within its parent… thanks

Your code so far

<!-- file: index.html -->
<link rel="stylesheet" href="styles.css">
<main id="main">
        <h1 id="title">MR Khalid Marshal</h1>
        <div id="img-div">
            <img id="image" src=https://tribute-page.freecodep.rocks" alt="descriptio">
            <div id="img-caption">Marshal is soo fine</p>
        </div>
        <section id="tribute-info">
            <p>Khalid loves praying</p>
        </section>
        <a id="tribute-link" href="https://en.wikipedia.org/wiki/Norman_Borlaug" target="_blank">click here </a>
    </main>
/* file: styles.css */
 #image {
  display: block;
  max-width: 100%;
  height: auto;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15

Challenge Information:

Tribute Page - Build a Tribute Page

Hi there. You need to use margin left and right auto to center your image within it’s container.

thank you so much, I really appreciate.

1 Like