Placeholder for contenteditable div

后端 未结 12 1535
栀梦
栀梦 2020-12-12 23:18

I have the following: FIDDLE

The placeholder works fine and dandy until you type something, ctrl + A, and delete. If you do that, th

12条回答
  •  囚心锁ツ
    2020-12-13 00:07

    from Placeholder in contenteditable - focus event issue

    [contentEditable=true]:empty:not(:focus):before{
      content:attr(data-ph);
      color:grey;
      font-style:italic;
    }
    

提交回复
热议问题