Sobes.tech
Intern

What is a hyperlink?

sobes.tech AI

Answer from AI

Hyperlink (usually simply "link") — is an interactive element in an electronic document (for example, a web page) that, when activated (clicked or pressed), allows you to navigate to another part of the same document, to another document, or perform another action (such as downloading a file or sending an email).

Main aspects:

  • HTML element: Created using the <a> (anchor) tag in web development.
  • href attribute: Defines the address (URL) of the resource the link points to.
  • Text content: The text or image that is visible as part of the link and that the user clicks on.
  • Appearance: Usually underlined and colored blue or purple by default.
  • Color:
    • Blue: unvisited link.
    • Purple: visited link.
    • Red: active link (during clicking).
  • Types of URLs in href:
    • Absolute URL: Full address (with protocol, domain), e.g., https://www.example.com/page.html.
    • Relative URL: Address relative to the current document, e.g., ../another-page.html.
    • Anchor (Hash): Link to a specific fragment of the current page, e.g., #section-id.
  • target attribute: Defines where the linked document will open (e.g., _blank for a new window/tab).

Example HTML code:

<a href="https://www.example.com" target="_blank">Go to Example.com</a>