DONT ADD ANYTHING HERE!

  1. The a element (or anchor element), with its href attribute, creates a hyperlink to
    1. webpages
    2. files
    3. email addresses
    4. locations in the same page
    5. anything else a URL can address
  2. If the a element has an href attribute, then it represents a hyperlink (a hypertext anchor).
  3. If the a element has no href attribute, then the element represents a placeholder for where a link might otherwise have been placed, if it had been relevant
  4. The target, rel, media, hreflang, and type attributes must be omitted if the href attribute is not present

Notes

  1. href
    1. The URL that the hyperlink points to
    2. Links are not restricted to HTTP-based URLs
  2. target
    1. Where to display the linked URL, as the name for a browsing context
    2. A tab, window, or iframe (see target page)
  3. rel
    1. The rel attribute defines the relationship between a linked resource and the current document
    2. Valid on
      1. link
      2. a
      3. area
      4. form
    3. The supported values depend on the element on which the attribute is found
    4. noopener
      The noopener keyword for the rel attribute of the a, area, and form elements instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it — by not setting the Window.opener property on the opened window
  4. hreflang
    1. Specifies the language of the document in the link
    2. The attribute is purely advisory
    3. The value must be a valid BCP 47 language tag
  5. type
    1. Hints at the linked URL's format with a MIME type
    2. No built-in functionality
  6. javascript
    <a href="javascript:history.back()">go back</a>
                                    

Example (mailto)

HTML

<a href="mailto: johndoe@email.com?subject=Hello&body='hi' " 
    target="_blank" 
    rel="noopener">
    Mail John Doe
</a>

Browser


Example

HTML

<a href="https://www.google.ie/maps/@53.3652136,-6.3351105,10z?entry=ttu" 
    target="_blank" 
    rel="noopener">Google Maps
</a>

Browser


Example (telephone)

HTML

    <a href="tel:+49.157.0156">telephone +49 157 0156</a>

Browser


Example (jump to top/bottom)

HTML

    <a href="#top"> Jump to top </a>

    <div id="bottom"><a href="">Jump to Top</a></div>
    <a href="#bottom">Jump to bottom</a>

Browser

Note

You can use
  1. href="#top"
  2. href="#"
to link to the top of the current page

References