Tribute Page - Build a Tribute Page

Tell us what’s happening:
Describe your issue in detail here.
How do I center the image with it’s parent? I’ve already looked into the help forum, I’m still confused. What am I doing wrong?
Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <title>Kobe Bryant</title>
  <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <main id="main">
      <h1 id="title">Kobe Bean Bryant</h1>
      <h3 id="tribute-info">A professional NBA player, regarded as one of the greatest basketball players of all time. One that influenced several generations of not just basketball players, but athletes of all sports.
        </h3>
<div class="img-container" id="img-div">
<img
src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTtG6PjU_pVIhYrxoP0JmuIDeiMc9eJo2EW0A&usqp=CAU" alt="kobe" class="kobe-image" id="image"/>
<div class="caption" id="img-caption">Kobe play-making.
  </div>
</div>
<div class="life">
  <p class="life-header bold">Timeline of Kobe's NBA career and achievements</p>
  <ul id="tribute-info">
    <li><span class="bold">1996 -<span> Was the 13th pick of the 1996 NBA Draft at the young age 17, by the Charlotte Hornets.The Hornets would later go on to trade him to the Los Angeles Lakers.</li>
    <li><span class="bold">1997 -<span> Became a Slam Dunk Champion in the Rookie Challenge of All-Star Weekend.</li>
    <li><span class="bold">1999 -<span> Phil Jackson took over of as the Lakers head coach, Phil Jackson was a very crucial part of Kobe's career and legacy.</li>
    <li><span class="bold">2000 - 2002 -<span> Kobe, Shaq along with the other Laker players would go on to dominate the NBA and add to the Laker's dynasty with a three-peat (three championship titles in a row). To this day, 21 years later, no NBA team has achieve a three-peat.</li>
    <li><span class="bold">2006 -<span> Against the Toronto Raptors, Kobe scored an amazing 81 points. Which set the record for the second most points scored in a game behind Wilt Chamberlain with 100 points scored in 1962.</li>
    <li><span class="bold">2009 - 2010 -<span> Both fans and sports analysts were skeptical if Kobe could win a title without the asssitance of Shaq. But, this doubtfulness would later be silenced. Kobe, Pau Gasol along with the other Laker players would go to win two consecutive champtionships. Bringing Kobe's title total to five.</li>
    <li><span class="bold">2016 - 2017 -<span> Due to a long list of injuries that hindered his playing abilities. Kobe would announce his retirement in 2016. Both his Laker jerseys, 8 and 24 would also retire in 2017.</li>
    <li><span class="bold"> 2018 -<span> A little after his retirement, Kobe won an Oscar at the 90th Academy Awards for Best Animated Short Film "Dear Basketball."</li>
    <li><span class="bold">2020 -<span> On January 26th, Kobe, his daughter Ginna and several others died in a helicopter crash</li>
    <li><span class="bold">2021 -<span> Kobe was posthumorously voted into the Basketball Hall of Fame</li>    
      </ul>
      </div>
      <h3>If you have time, you should read more about this incredible legend
        <a id="tribute-link" href="https://en.wikipedia.org/wiki/Kobe_Bryant" target="_blank"></a>
      </main>
      </body>
      </html>
/* file: styles.css */
#image {
  max-width: 100%; 
  display: block;
}

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS aarch64 15278.64.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

hi you can try with margin set up to -
margin: 0 auto;

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