![]() |
VOOZH | about |
HTML Links, also known as Hyperlinks, are used to connect one web page to another, allowing users to navigate easily between different pages, websites, or sections within the same page.
Output:
By default, links will appear as follows in all browsers:
The target attribute in the <a> tag specifies where to open the linked document. It controls whether the link opens in the same window, a new window, or a specific frame.
Output
| Attribute | Description |
|---|---|
_blank | Opens the linked document in a new window or tab. |
_self | Opens the linked document in the same frame or window as the link. (Default behavior) |
_parent | Opens the linked document in the parent frame. |
_top | Opens the linked document in the full body of the window. |
framename | Opens the linked document in a specified frame. The frame’s name is specified in the attribute. |
Below are examples of how to link different HTML elements with their respective code snippets
| Element to Interlink | Specific Code |
|---|---|
| Linking to an image | <a href="image.jpg"><img src="image.jpg" alt="Image"></a> |
| Link to an Email Address | <a href="mailto:someone@example.com">Send Email</a> |
| Phone Number | <a href="tel:+1234567890">Call Now</a> |
| Button | <a href="https://www.example.com/"> <button>Visit Example</button> </a> |
| Link to Download File | <a href="file.pdf" download>Download File</a> |
| Link Title | <a href="https://www.example.com/" title="Visit Example">Link Text</a> |