scott.sanders
scott.sanders 1d ago β€’ 0 views

HTML Link Examples: Absolute, Relative, and Email Links with Code Snippets

Hey there! πŸ‘‹ Learning HTML links can seem tricky at first, but it's super important for building websites. I've put together a quick study guide and a practice quiz to help you master absolute, relative, and email links. Let's get started! πŸš€
πŸ’» Computer Science & Technology

1 Answers

βœ… Best Answer
User Avatar
timothy_perez Dec 28, 2025

πŸ“š Quick Study Guide

  • πŸ”— Absolute Links: Full URLs, like https://www.eokultv.com. Use them to link to other websites.
  • πŸ“ Relative Links: Link to pages within the same website. For example, /about.html. Make sure to use forward slashes (/) for paths.
  • πŸ“§ Email Links: Use mailto: to create clickable email addresses. Example: <a href="mailto:info@example.com">Email Us</a>.
  • πŸ“ File Paths: When linking to files within your project, be mindful of the file structure. img/logo.png implies the image is in an img folder.
  • 🌐 Base URL: A base URL can be defined in the <head> section to simplify relative links.
  • 🧲 Target Attribute: Use target="_blank" to open links in a new tab.
  • πŸ’‘ Best Practice: Always test your links! Broken links hurt user experience.

Practice Quiz

  1. Which HTML tag is used to define a hyperlink?
    1. <link>
    2. <a>
    3. <url>
    4. <hyperlink>
  2. What is the correct HTML for creating an email link?
    1. <a href="emailto:someone@example.com">Send Email</a>
    2. <mail href="someone@example.com">Send Email</mail>
    3. <a href="mailto:someone@example.com">Send Email</a>
    4. <a mail="someone@example.com">Send Email</a>
  3. What does the `target="_blank"` attribute do?
    1. Opens the link in the same tab.
    2. Opens the link in a new window or tab.
    3. Opens the link in a parent frame.
    4. Opens the link in an inline frame.
  4. Which of the following is an example of an absolute URL?
    1. /images/logo.png
    2. index.html
    3. www.example.com/page1.html
    4. ../styles/style.css
  5. What is a relative link?
    1. A link to another website.
    2. A link that specifies the complete address of a resource on the internet.
    3. A link to a resource within the same website.
    4. A link that only works offline.
  6. If your HTML file is in the root directory and your image is in a folder called "images", what is the correct relative path?
    1. /images/image.jpg
    2. images/image.jpg
    3. ../images/image.jpg
    4. ./images/image.jpg
  7. Which attribute is used to define the URL of the linked page?
    1. src
    2. href
    3. url
    4. link
Click to see Answers
  1. B
  2. C
  3. B
  4. C
  5. C
  6. B
  7. B

Join the discussion

Please log in to post your answer.

Log In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! πŸš€