Last active
December 21, 2015 18:29
-
-
Save mrmoje/6347800 to your computer and use it in GitHub Desktop.
Placeholder string solution for contentEditable html elements (Created on codepen.io)
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
<div contentEditable=true data-ph="My Placeholder String"></div> |
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
[contentEditable=true]{ | |
border:1px solid grey; | |
} | |
[contentEditable=true]:empty:not(:focus):before{ | |
content:attr(data-ph); | |
color:grey; | |
font-style:italic; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a way to implement a placeholder string for contentEditable html elements