Elements and Structure 9/14: Linking at Will


#1

The instruction is
“In index.html, transform the image on your page into a link by wrapping the image element with an anchor element. Set the target attribute so that the link opens in a new window.”

I don’t really understand what I’m supposed to do…

https://www.codecademy.com/courses/learn-html-elements/lessons/common-html-elements/exercises/linking-at-will-html?action=resume_content_item&course_redirect=learn-html


#2

Locate the anchor tag in the markup (around line 16) and add a target attribute to it that reads,

target="_blank"

Recall that HTML elements have a type, and they have attributes.

<a href="" target=""></a>

nodetype => a
attributes => href, target

<type attribute="value">

#3

Still not getting it.


#4

There is Wikepedia link at around line 16 of the HTML. It will already have an href attribute set to the URL of the Wikepedia page, and if I’m not mistaken it has a target attribute as well…

<a href="https://en.wikipedia.org/wiki/Brown_bear" target="_blank">Learn More</a>

above is an example to follow, only this time instead of the link text, use the image at around line 46.

<a href="https://en.wikipedia.org/wiki/Brown_bear" target="_blank"><img src=" ... "></a>

That will make the image clickable, and it will open to the same page as the Learn More link…


#5

Never mind.
Thank you for your time.


#7

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