0
0
HTMLmarkup~10 mins

Anchor tag basics in HTML - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a link to example.com.

HTML
<a href="[1]">Visit Example</a>
Drag options to blanks, or click blank then click option'
Aexample
Bwww.example.com
Chttps://example.com
Dhttp://example
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out 'https://' causes the link to break.
Using just 'example' is not a valid URL.
2fill in blank
medium

Complete the code to open the link in a new browser tab.

HTML
<a href="https://example.com" [1]>Open in new tab</a>
Drag options to blanks, or click blank then click option'
Atarget="_self"
Btarget="_blank"
Crel="nofollow"
Dhref="_blank"
Attempts:
3 left
💡 Hint
Common Mistakes
Using target="_self" opens in the same tab.
Putting href="_blank" is invalid.
3fill in blank
hard

Fix the error in the anchor tag to make the link valid.

HTML
<a [1]>Click here</a>
Drag options to blanks, or click blank then click option'
Ahref="https://example.com"
Blink="https://example.com"
Csrc="https://example.com"
Dhref=https://example.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using link or src instead of href.
Not putting quotes around the URL.
4fill in blank
hard

Fill both blanks to create a link that opens in a new tab and is safe for security.

HTML
<a href="https://example.com" [1] [2]>Secure Link</a>
Drag options to blanks, or click blank then click option'
Atarget="_blank"
Brel="noopener"
Crel="noreferrer"
Dtarget="_self"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting rel="noopener" when using target="_blank".
Using target="_self" which opens in the same tab.
5fill in blank
hard

Fill all three blanks to create a link with text, URL, and open it safely in a new tab.

HTML
<a href="[1]" [2] [3]>Visit Site</a>
Drag options to blanks, or click blank then click option'
Ahttps://openai.com
Btarget="_blank"
Crel="noopener"
Drel="nofollow"
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out rel="noopener" causes security risks.
Using rel="nofollow" instead of rel="noopener" for this purpose.