Created
May 12, 2015 08:00
-
-
Save emolr/0ff3481c9a59014abf45 to your computer and use it in GitHub Desktop.
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 placeholder | |
* ----------------------------------- | |
* Emulates the behavior of the standerd implementation | |
* of the input placeholder="text", but can be used on any | |
* html element that supports focus. | |
* http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus | |
*/ | |
[contenteditable="true"]:before { | |
content:attr(placeholder); | |
pointer-events: none; | |
} | |
[contenteditable="true"]:not(:empty):before{ | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment