0
0
HTMLmarkup~20 mins

Anchor tag basics in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Anchor Tag Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
1:30remaining
What is the visible text of this anchor tag?
Look at the anchor tag below. What text will you see on the webpage?
HTML
<a href="https://example.com">Visit Example</a>
Ahttps://example.com
BClick here
Cexample.com
DVisit Example
Attempts:
2 left
💡 Hint
The text between and tags is what shows on the page.
🧠 Conceptual
intermediate
1:30remaining
What does the href attribute do in an anchor tag?
Choose the best description of the href attribute in an anchor tag.
AIt defines the URL the link points to.
BIt sets the color of the link text.
CIt makes the link open in a new tab.
DIt adds a tooltip when hovering over the link.
Attempts:
2 left
💡 Hint
Think about what happens when you click a link.
📝 Syntax
advanced
2:00remaining
Which anchor tag opens the link in a new browser tab?
Select the anchor tag code that opens the link in a new tab when clicked.
A<a href="https://example.com" newtab>Open in new tab</a>
B<a href="https://example.com" target="new">Open in new tab</a>
C<a href="https://example.com" target="_blank">Open in new tab</a>
D<a href="https://example.com" open="new">Open in new tab</a>
Attempts:
2 left
💡 Hint
The target attribute controls where the link opens.
accessibility
advanced
2:00remaining
Which anchor tag is best for accessibility?
Choose the anchor tag that improves accessibility by describing the link purpose clearly.
A<a href="https://example.com">Click here</a>
B<a href="https://example.com" aria-label="Visit Example website">Example</a>
C<a href="https://example.com">Example</a>
D<a href="https://example.com" title="Example">Link</a>
Attempts:
2 left
💡 Hint
Screen readers use aria-label to describe links better.
selector
expert
2:30remaining
Which CSS selector styles only anchor tags inside a nav element?
Select the CSS selector that applies styles only to anchor tags inside a
Anav a { color: blue; }
Ba nav { color: blue; }
Cnav > a { color: blue; }
Da > nav { color: blue; }
Attempts:
2 left
💡 Hint
Think about how CSS selects child elements inside parents.