Build a Tribute Page - Test: Your #image should have a height of auto

I have a problem, with one of tests. Despite the fact that all tests are passed I can’t get the
“Your #image should have a height of auto.” passed. My code is done like this in my css file
‘’’
#image
{
display: block;
max-width: 100%;
height: auto;
}
‘’’
Why the test isn’t passed? I cannot turn in my whole project because of this problem.

can you send your entire code?

sometimes error is not really what error displays, but something else. like maybe you didnt close bracket or something similar.

body
{
    background-color: white;
    width: 100%;
    text-align: center;
    margin: 0;
    font-family: Arial, sans-serif;
}

#main
{
    background-color: lightgrey;
    margin: 30px 8px;
    padding: 15px;
    border-radius: 5px;
}

span
{
    display: block;
    max-width: 100%;
    margin: auto;
    padding: 15px;
}

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

#img-div
{
    background-color: #D8D8D8;
    border-radius: 5px;
    align-content: center;

}

#img-caption
{
    font-style: italic;
    font-size: 15px;
}

h2
{
    padding: 30px;
}

ul
{
    max-width: 525px;
    text-align: left;
    margin: 0 auto 50px auto;
}

li
{
    padding: 10px;
    font-size: 16px;
    line-height: 1.5;
}

#cite
{
    max-width: 530px;
    text-align: left;
    margin: 0 auto 50px auto;
    font-style: italic;
}

#cite > cite
{
    font-style: normal;
}

a
{
    color: black;
}

a:visited
{
    color: darkgrey;
}

there should be only one ID # in image.

rest of styling should come via classes or via applying it to img element itself.

id’s are specific in a way that you cant have more than one under same name or on one element.

I don’t think that I understand what are you talking about. There is only one # called “image” the rest img are there beacuse of the description. So where do you have 2 images?
Or do I missunderstand something in your explanation?

Do you know the place where I can report a bug in this exercise or check the source code of this particular test that I need to pass? Beacuse if i’m passing any other tests that are connected with #image I don’t understand why this particular one cannot be passed(if I did something wrong with the #image tests I would’t pass the other 2)

there is no bug in exercise, only in your code.

I already told you not to have multiple id’s on one element because that’s not allowed in html.

Style as much as possible with classes when you code. Or with styling img element itself. Do not use id for styling unless required.

I found my mistake and it was caused by setting width in my html img but thx for your answers though.

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