Confused my Tribute Page semantics: img-caption test error

Confused my Tribute Page semantics: img-caption test error
0

#1

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?


#2

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.


#3

Any updates on this?


#4

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


#5

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.


#6
    <div id="img-div">
 <img id="image" src="ADD YOUR SOURCE" alt="YOUR DESCRIPTION" </img>
    <h2 id="img-caption"> 
    YOUR DESCRIPTION</h2>
     </div>

#7

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.


#8

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


#12

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.