0
0
HTMLmarkup~5 mins

Anchor tag basics in HTML - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the <a> tag in HTML?
The <a> tag creates a clickable link that can take you to another webpage, a different part of the same page, or start an email.
Click to reveal answer
beginner
What attribute of the <a> tag specifies the destination URL?
The href attribute sets the URL where the link will go when clicked.
Click to reveal answer
beginner
How do you make a link open in a new browser tab?
Add target="_blank" to the <a> tag to open the link in a new tab.
Click to reveal answer
intermediate
Why should you use the rel="noopener noreferrer" attribute with target="_blank"?
It improves security and privacy by preventing the new page from accessing the original page's window object.
Click to reveal answer
beginner
What does this anchor tag do? <a href="#section2">Go to Section 2</a>
It links to a part of the same page with the ID section2, scrolling the page to that section.
Click to reveal answer
Which attribute is required to make an <a> tag a clickable link?
Ahref
Bsrc
Calt
Dtitle
What happens if you omit the href attribute in an <a> tag?
AThe link opens in a new tab.
BThe link will not be clickable.
CThe link downloads a file.
DThe link scrolls to the top of the page.
How do you make a link open in the same tab?
ANo attribute needed; default is same tab
BAdd <code>target="_blank"</code>
CAdd <code>rel="noopener"</code>
DAdd <code>target="_self"</code>
What does href="#top" do in an anchor tag?
AOpens a new tab
BLinks to a page named 'top'
CLinks to the top of the current page
DDownloads a file named 'top'
Which attribute improves security when using target="_blank"?
Ahref="noopener"
Balt="noopener"
Ctarget="_self"
Drel="noopener noreferrer"
Explain how to create a link that opens a new website in a new browser tab using the anchor tag.
Think about the attributes needed for the link destination and opening behavior.
You got /4 concepts.
    Describe how you can link to a specific section within the same webpage using an anchor tag.
    Consider how the URL can point to a part of the current page.
    You got /3 concepts.