HTML5 Content Editable practice, html5editable
Based on this development documentation: https://developer.mozilla.org/zh-CN/docs/Web/Guide/HTML/Content_Editable
Problem: the input box implemented through contenteditable does not have placeholder, So I implemented it myself.
.cd-write{background:#fafafa;padding:8px 12px;position:fixed;left:0;right:0;bottom:0;border-top:solid 1px #dfdede;z-index:10;}.cd-write .btn{background:#fda626;color:white;height:34px;font-size:16px;width:60px;text-align:center;border-radius:5px;line-height:34px;position:fixed;bottom:11px;right:12px;}.cd-write .input{overflow:hidden;padding:8px 6px;border:solid 1px #ebebeb;overflow:auto;background:white;border-radius:5px;min-height:16px;max-height:100px;line-height:140%;outline:none;margin-right:70px;}.cd-write .input:empty:before{content: attr(placeholder);color:#bbb;}
<Div class = "cd-write"> <div class = "btn"> send </div> <div class = "input" contentEditable = "true" placeholder = "comment"> </div>