Skip to content

Instantly share code, notes, and snippets.

@jbail
Created December 23, 2012 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbail/4366249 to your computer and use it in GitHub Desktop.
Save jbail/4366249 to your computer and use it in GitHub Desktop.
A CodePen by Jeff Bail.
<p><strong>Example 1</strong>: The link below will be jumpy when hovered because borders take up space and there are none defined for the "off" state.</p>
<p><a href="#" class="border-jumpy">I'm jumpy</a></p>
<p><strong>Example 2</strong>: The link below has a transparent border in the "off" state, so it won't be jumpy when hovered.</p>
<p><a href="#" class="border-calm">I'm calm</a></p>
a {
display:inline-block;
padding:3px 12px;
}
.border-jumpy:hover {
border:5px dotted gray;
}
.border-calm {
border:5px solid transparent;
}
.border-calm:hover {
border:5px dotted gray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment