Mlove44
October 21, 2022, 11:16pm
1
Add a target
attribute with the value _blank
to the anchor (a
) element’s opening tag, so that the link opens in a new tab.
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<p>Click here to view more <!-- TODO:_blank--> <a href="https://freecatphotoapp.com">cat photos</a> </p>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
</main>
</body>
</html>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Challenge: Learn HTML by Building a Cat Photo App - Step 14
Link to the challenge:
hbar1st
October 21, 2022, 11:18pm
2
please restart this step (you have added code that was not requested by this exercise).
After you restart, add the new target attribute to the anchor tag.
(it should be very similar to how the href attribute looks)
We can read the instructions ourselves, so doesn’t really help us help you. It helps more if you talk to us about how the instructions are confusing you.
Talking about code takes practice to get good at.
Mlove44
October 21, 2022, 11:39pm
4
How to add a target
attribute with the value _blank
to the anchor (a
) element’s opening tag, so that the link opens in a new tab. I am stuck on this lesson.
hbar1st
October 21, 2022, 11:40pm
5
Look at the href attribute. The target attribute is exactly the same but it is called target and has a different value.
Mlove44
October 21, 2022, 11:42pm
6
Ok well I am trying to figure out what is the target attribute and _blank to the anchor meaning.
Mlove44
October 21, 2022, 11:46pm
7
Do I add another anchor and put in the word Target_blank. I am confused.
hbar1st
October 21, 2022, 11:52pm
8
No don’t add another element. Just put your mouse inside the anchor opening tag (where the href is) and add the target there. (Just like href but called target).
This is a src attribute.
This is an alt attribute.
This is a href attribute.
You need a target attribute.
Mlove44
October 22, 2022, 12:17am
10
Would targe attribute would be Open a new tab? Also, what is the _blank value? This is where I got stuck.
1 Like
Mlove44
October 22, 2022, 12:19am
11
Oh so what would be the _blank value?
hbar1st
October 22, 2022, 12:21am
13
When someone asks you to add an href attribute, what do you do?
You go to the anchor tag and write
href=“value”
And the value here is the website link right?
Target is an attribute just like href.
So just type the word target next to the href and then put the equal sign then open double quotes and put the value _blank in there.
2 Likes
Mlove44
October 22, 2022, 12:57am
14
How to put links in a image?
If you have a question about a new step, it is best to use the Ask for Help button again
system
Closed
April 22, 2023, 1:01pm
16
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.