Placeholder in contenteditable - focus event issue

后端 未结 11 2090
无人共我
无人共我 2020-12-07 10:05

I have been trying to ask this before, without any luck of explaining/proving a working example where the bug happens. So here is another try:

I’m trying to replicat

11条回答
  •  Happy的楠姐
    2020-12-07 10:29

    All you need is this little solution

    [contenteditable=true]:empty:before{
      content: attr(placeholder);
      display: block; /* For Firefox */
    }
    

    Demo: http://codepen.io/flesler/pen/AEIFc

提交回复
热议问题