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?
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
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.
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.