Created
February 26, 2014 22:15
-
-
Save jvandyke/9239770 to your computer and use it in GitHub Desktop.
Replace text in an element with CSS
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
.element { | |
text-indent: -9999px; | |
line-height: 0; /* Collapse the original line */ | |
} | |
.element::after { | |
content: "New text"; | |
text-indent: 0; | |
display: block; | |
line-height: initial; /* New content takes up original line height */ | |
} |
Works fine. It's very interesting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should work for IE8+.
Here it is in a Fiddle.