Confused my Tribute Page semantics: img-caption test error

I’m finishing up my Tribute Page project and I have one failing test. It reads:

Within the “img-div” element, I should see an element with a corresponding id=“img-caption” that contains textual content describing the image shown in "img-div"

Here’s my code:

<div id="img-div">
       <img src="dr_mae_c_jemison.jpg" alt="" id="image">
       <caption id="img-caption"><em>Dr. Mae C. Jemison's official NASA photo</em></caption>
 </div>

I think the test is looking for a caption code, which I have, but my code isn’t passing. However, it passes when I change the caption to a paragraph. I don’t understand. I do not think a paragraph tag is semantic in this situation. Am I wrong/overthinking or is this a bug?

similar issues here,starting to get bit frustrating :slight_smile: i get 6/10 and tried bit of everything but have to keep looking and trying.

Any updates on this?

Within the “img-div” element, I should see an element with a corresponding id=“img-caption” that contains textual content describing the image shown in "img-div"

"img-caption" might mean anything between <h1> to <h6> tags

Bruh , i dont even get why we are using a div with the id of main as the main container, when we should have used the main element instead.

2 Likes
    <div id="img-div">
 <img id="image" src="ADD YOUR SOURCE" alt="YOUR DESCRIPTION" </img>
    <h2 id="img-caption"> 
    YOUR DESCRIPTION</h2>
     </div>
8 Likes

You will need to change The stuff in CAPS. I could not add color to distinguish it. Good luck. This took me 2 hrs to figure out. Silly really.

1 Like

Ugh, I was stuck for almost two hours on this too and couldn’t figure it out. Thank you so much!

Sorry this is late as heck…

You actually can use the main tag with that id. For the img-caption, I used it with the figcaption tag inside of a figure tag that had my img tag inside of it too. I’d say to experiment with where you can put your id’s. Sometimes they’re really particular (technical documentation project…) and sometimes they aren’t. But you should definitely keep it up with the semantic tags, it’s always good practice.

1 Like

Just a quick reminder, “img” element is a self closing tag, no need for (/img)

So frustrated with this one!!! I have been working on it for several hours, I copy and pasted your code but got nothing. Losing my mind!

1 Like

Did it work for you? i tried but it didn’t work! Crying cuz I am bold now from pulling al my hair out over this problem!

Hi @annschrader7777,

Did you get it working? If not, I would suggest to share your code so others can give you pointers. No need to be frustrated on your own. :slight_smile:

<div id ="img-div"> 
          <img src="https://www.biography.com/.image/t_share/MTE1ODA0OTcxODAxNTQ0MjA1/mother-teresa-9504160-1-402.jpg" id="image">
          
<figcaption id="img-caption"><em>Mother teresa photo</em></figcaption>

   </div>

If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.