当DIV加上contenteditable="true"作textarea用时,光写placeholder是没有效果的。
.prefix_content:empty:before{ content: attr(placeholder); color:#bbb; } .prefix_content:focus:before{ content:none; }
加上以上代码后,placeholder就生效了
当DIV加上contenteditable="true"作textarea用时,光写placeholder是没有效果的。
.prefix_content:empty:before{ content: attr(placeholder); color:#bbb; } .prefix_content:focus:before{ content:none; }
加上以上代码后,placeholder就生效了
本文链接:对DIV做placeholder效果 ,花了好多脑细胞写的,转载请注明链接喔~~