HTMHell supports Black Lives Matter. ✊🏾 Code is always political.

#4 link-also-button

submitted on by Hidde

Bad code Bad code

<a href="">

Issues and how to fix them Issues and how to fix them

  1. By nesting a button inside of a link, you’re sending two messages: this is a button, but also this is a link.
  2. If you’re not sure when to use <a> or <button>, watch The Links vs. Buttons Showdown by Marcy Sutton.

Good code Good code

.button {
/* use CSS to apply button-like styles to the link */
<a href="" class="button">Example</a>