Absolutely! An HTML anchor tag (`<a>`) is used to create hyperlinks. It's one of the most fundamental building blocks of the web—connecting pages, sites, files, and even triggering scripts. Here's its basic structure:
### 🧱 Anchor Tag Anatomy
```html
<a href="https://example.com" target="_blank" rel="noopener noreferrer" class="link-class">Click me</a>
```
### 🧩 Key Attributes
- **`href`** – The destination URL of the link. Can be absolute (`https://...`) or relative (`/page.html`).
- **`target`** – Defines how the link opens:
- `_self` (default) opens in the same tab
- `_blank` opens in a new tab
- **`rel`** – Establishes the relationship between the current page and the linked URL. Security-relevant values include:
- `noopener` prevents the new page from gaining access to the originating window
- `noreferrer` hides referrer info
- **`class` / `id`** – For styling and DOM targeting
- **`title`** – Adds a tooltip on hover
- **`download`** – Enables link to prompt file download
### 🌐 Anchor Tag Examples
| Purpose | Example |
|--------|--------|
| Link to external site | `<a href="https://gov.au">Government Portal</a>` |
| Download a file | `<a href="/docs/report.pdf" download>Download Report</a>` |
| Email link | `<a href="mailto:info@example.com">Email Us</a>` |
| Phone link | `<a href="tel:+61212345678">Call Us</a>` |
| JavaScript trigger | `<a href="#" onclick="doSomething()">Run Script</a>` |
If you’re wrangling links inside a framework or a dynamic context (e.g. Angular or React), some behavior might get augmented by routing libraries or security rules. Want me to look at any specific anchor tag you’ve got tucked in that DOM snippet?
