You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Links and images are two of the most important elements on the web. Links connect pages together and form the fabric of the internet. Images bring visual content to life. Mastering the <a> and <img> elements — along with their attributes — is essential for building any website.
<a> ElementThe anchor element <a> creates a hyperlink:
<a href="https://www.example.com">Visit Example</a>
| Attribute | Purpose | Example |
|---|---|---|
href | The URL the link points to | href="https://example.com" |
target | Where to open the link | target="_blank" (new tab) |
rel | Relationship to the linked page | rel="noopener noreferrer" |
title | Tooltip text on hover | title="Visit our homepage" |
download | Download the linked file | download="report.pdf" |
<!-- External link (absolute URL) -->
<a href="https://www.example.com">External Site</a>
<!-- Internal link (relative URL) -->
<a href="/about.html">About Page</a>
<a href="contact.html">Contact Page</a>
<!-- Link to a section on the same page (anchor/fragment) -->
<a href="#section2">Jump to Section 2</a>
...
<h2 id="section2">Section 2</h2>
<!-- Email link -->
<a href="mailto:hello@example.com">Send Email</a>
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.