# How to Add a Hyperlink in HTML: A Complete Guide Hyperlinks are the backbone of the web. Every clickable link you've ever followed — whether jumping between pages, downloading a file, or launching an email client — starts with the same HTML element: the **anchor tag**. Understanding how it works gives you precise control over how your content connects to the rest of the web. ## The Core Syntax: The ` ` Tag The HTML anchor element uses this basic structure: ```html Click here ``` Breaking that down: - **` `** — the opening anchor tag - **`href`** — stands for *hypertext reference*; this attribute holds the destination URL - **The text between tags** — what the user sees and clicks - **``** — the closing tag That's the minimum viable hyperlink. Everything else builds on this foundation. ## Types of Links You Can Create ### External Links These point to pages on other websites. Use the full absolute URL: ```html Visit Wikipedia ``` ### Internal Links These navigate between pages within your own site. You can use **relative paths**, which are shorter and easier to maintain: ```html About UsContactRead Post ``` Relative paths work relative to the current file's location in your directory structure. ### Anchor Links (Jump Links) These link to a specific section *within the same page*. First, assign an `id` to the target element: ```html

Pricing

``` Then link to it with a `#` prefix: ```html Jump to Pricing ``` You can also link to a section on a *different* page: ```html Features: Pricing Section ``` ### Email and Phone Links HTML supports `mailto:` and `tel:` protocols directly in the `href`: ```html Email UsCall Us ``` Clicking a `mailto:` link opens the user's default email client. A `tel:` link on mobile devices initiates a call. ## Essential Link Attributes Beyond `href`, several attributes meaningfully change how a link behaves: | Attribute | Purpose | Common Values | |---|---|---| | `href` | Sets the destination | URL, path, `#id`, `mailto:`, `tel:` | | `target` | Controls where link opens | `_blank`, `_self`, `_parent`, `_top` | | `rel` | Defines relationship to destination | `noopener`, `noreferrer`, `nofollow` | | `title` | Tooltip text on hover | Any descriptive string | | `download` | Triggers file download | Optional filename | ### Opening Links in a New Tab 🔗 ```html Open in New Tab ``` `target="_blank"` opens the link in a new browser tab. **Always pair it with `rel="noopener noreferrer"`** — this prevents the newly opened page from accessing your page's window object, closing a known security vulnerability called *reverse tabnapping*. ### Downloadable File Links ```html Download Report ``` The `download` attribute tells the browser to download the file instead of navigating to it. The optional value sets the suggested filename. ## Linking Images and Other Elements Any HTML element can become a clickable link by wrapping it in ` ` tags. Images are the most common example: ```html Example Company Logo ``` You can also wrap buttons, divs, or entire card components — though for **accessibility**, wrapping interactive elements like `