Links Exercise
Master the anchor tag to create hyperlinks, understand link attributes, and learn proper link styling techniques.
Loading...
Loading exercise code...
Exercise: Master HTML Links
Objectives
In this exercise, you will:
- Learn the
<a>(anchor) tag for creating hyperlinks - Understand different link attributes (href, target, title)
- Practice linking to external and internal pages
- Learn how to embed media like videos and iframes
- Practice styling links with CSS
What You’ll Learn
The Anchor Tag:
<a href="...">- Makes clickable linkshref- The URL to navigate totarget="_blank"- Opens link in new tabtarget="_self"- Opens in same tab (default)title="..."- Tooltip text on hover
Common Link Types:
- External links - Link to other websites
- Internal links - Link to other pages on your site
- Email links -
href="mailto:email@example.com" - Anchor links - Link to sections:
href="#section"
Embedded Media:
<iframe>- Embed external content like YouTube videos- Attributes:
width,height,src,title
Challenges in This Exercise
- Add social media links - Uncomment and customize the social links
- Fix the video embed - Ensure the YouTube iframe is displaying correctly
- Add new sections - Create more profile sections with links
Tips for Success
- Always use
target="_blank"for external links - Use meaningful link text (avoid “Click here”)
- Test all links work before publishing
- Style links with
:hoverin CSS for better UX - Validate that iframe embeds are from trusted sources
Next Steps
After completing this exercise:
- Add more social media links
- Practice linking to different sections of a page
- Try embedding different types of content
- Move on to the Tables exercise!