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 -->
<!-- User Editable Region -->
<p> See more <a href =" https://freecatphotoapp.com"> cat photos</a> in our gallery.</p>
<!-- User Editable Region -->
<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/122.0.0.0 Safari/537.36 Edg/122.0.0.0
In order to identify what it is asking we must understand the terminology that it is using. Do you know what an attribute is?
Perhaps this diagram might explain the simple parts.
+--------------- Element -------------+
| |
+--- Start tag --+ End tag +--+
| | | |
<p class="saying">live and let live</p>
| || || |
| || |+-----Content----+
| |+-------+
| |Attribute
+----+ Value
Attribute
Name
Hello and welcome to freeCodeCamp
You have edited the text of the p element. Reset your step to get it back to the original.
Then in your a element opening tag add a target attribute with the value set to blank
Example: <a target="_self href="#">
a tag has an attribute “target” to set the position of opening the link address in your browser. By default the value of “target” is “_self” so the link will open in the same tab.
Target attribute have 2 main values _self: Default, To open the link in the same tab. _blank: To open a link in a new tab.
eg. -
Target also have 2 more values which are not important at this point as they were used with iFrames:
“_parent” & “_top”.