Tribute Page - Build a Tribute Page

Tell us what’s happening:
Describe your issue in detail here.

Your code so far
I think I followed the instruction right.
can you help me what is wrong with these?
These are the requirements that is not met:

  • Your img element should have a display of block.

  • Failed:Your #image should have a max-width of 100%.
    Your #image should be centered within its parent.

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
  <meta charset="UTF-8">
  </head>
  <title id="title">Charmander</title>
  <main id="main">
    <div id="img-div">
    <img src="https://cdn.pixabay.com/photo/2019/02/27/00/20/small-4023176_1280.jpg" alt="pokemon" id="image"/>
    <div id="img-caption">Charmander</div>
    <h1 id="tribute-info"><a href="https://www.pokemon.com/us" id="tribute-link" target="_blank">Info on Charmander</a></h1>
    </div>
  </main>
  </html>

/* file: styles.css */
.image {
  display: block;
  max-width:100%;
  height: auto;
  text-align: center;
}

Your browser information:

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

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

that’s not how to center an image in css.

use margin or flexbox

Thanks, I solve the problem I did not link the css to my html hahaha

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