Stuck on the first Tribute Page :<

  • Your img element should have a display of block.

  • Failed:Your #image should have a max-width of 100%.

  • Failed:Your #image should be centered within its parent.

Is this code for CSS correct ? :thinking:
:::

img {
    max-width: 100%;
    display: block;
    margin-left: auto;
}
1 Like

Hi!
In order to help we need to see all your html and css code, as there may be a mistake elsewhere making the test fail.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

technically it is correct, but the step is telling you to use img for the display property, and use the class selector #img for your max width and margin left properties

No, you used the “img” tag it wants you to add css to the “#image” tag which selects the #image id

#image {
    max-width: 100%;
    display: block;
    margin-left: auto;
}

I have that same problem too :confounded:

you need to create two different selectors. one for the img element and one for the img class as per requirements