Created
August 17, 2018 03:05
-
-
Save wklsh/fe1c2d79480d28289783fa7d7f14530d to your computer and use it in GitHub Desktop.
Prevent elements from shifting around on hover / active text bolds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a:hover { | |
font-weight:bold; | |
} | |
a::after { | |
display: block; | |
content: attr(data-text); | |
font-weight: bold; | |
height: 0; | |
overflow: hidden; | |
visibility: hidden; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li><a href="#" title="height">height</a></li> | |
<li><a href="#" title="icon">icon</a></li> | |
<li><a href="#" title="left">left</a></li> | |
<li><a href="#" title="letter-spacing">letter-spacing</a></li> | |
<li><a href="#" title="line-height">line-height</a></li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment