Skip to content

Instantly share code, notes, and snippets.

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 mrmoje/6347800 to your computer and use it in GitHub Desktop.
Save mrmoje/6347800 to your computer and use it in GitHub Desktop.
Placeholder string solution for contentEditable html elements (Created on codepen.io)
<div contentEditable=true data-ph="My Placeholder String"></div>
[contentEditable=true]{
border:1px solid grey;
}
[contentEditable=true]:empty:not(:focus):before{
content:attr(data-ph);
color:grey;
font-style:italic;
}
@mrmoje
Copy link
Author

mrmoje commented Aug 26, 2013

Just a way to implement a placeholder string for contentEditable html elements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment