Tribute page anchor attribute

Hi there, newbie coder here :slight_smile:
I’m doing the Tribute page and for some reason the requirement for the anchor challenge isn’t working.

Here are the instructions for the part I’m stuck on: User Story #7: I should see an a element with a corresponding id=“tribute-link”, which links to an outside site that contains additional information about the subject of the tribute page. HINT: You must give your element an attribute of target and set it to _blank in order for your link to open in a new tab (i.e. target="_blank").

And here’s the code I have, which isn’t working:

<p id="moreinfo"> For more about this incredible composer, check out his 
    <a id="tribute-link" href = "" target="_blank"> Wikipedia</a> page. </p>

Any help would be much appreciated!

<p id="moreinfo">For more about this incredible composer, check out his 
<a id="tribute-link" href="" target="_blank">Wikipedia</a> page.</p>

After href cant be space href=" must be! Also after p tag is no need space to write text! And again for a tag no need space only after a tag when used link. So remove space from Wikipedia.

You should be passing #7 with the code you have. The syntax is valid but I wouldn’t suggest using it (i.e. adding spaces)

Do you have a Codepen for the project so we can see it?

Here it is:

I see this test not passing, not the one you are saying:

  1. 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”.

your code there is this:

 <div id="img-div">
    <img id="image" src="" alt="Sondheim">
      <p id="img-caption" >Stephen Sondheim directing Company in 1973.</p>
    <img id="img2" src="" alt="Sondheim">

Ok thanks! I did the change you suggested and it works! (Not sure why #7 wasn’t working before, but now it seems to be fine).

1 Like