Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

My best practice for html links

  • Don't use target="_blank" because that forces only one behavior, opening in a new tab. I should expect the user to open a link in a new tab if he wants to.
  • Don't omit the referrer, which is done by including rel="noreferrer". I want other sites to know who is linking to them, in the hopes of getting cross-traffic.
  • Do include rel="noopener" to protect users (reference 1).

References

Weblinks

  1. https://mathiasbynens.github.io/rel-noopener/
  2. https://css-tricks.com/use-target_blank/
  3. https://html.spec.whatwg.org/multipage/links.html#link-type-noopener

Comments