contenteditable within progress
<div class="f rel">
<div class="rel" contenteditable="plaintext-only"></div>
<progress class="abs rt" value="1" max="10"></progress>
</div>
.rel{position:relative}
.abs{position:absolute}
.f{background-color:aliceblue;width:44rem;min-height:6rem}
.f>*{width:100%}
.f>progress{top:0;height:3px;}
.f>[contenteditable]{outline:none;padding:0.4rem;height:auto}
/*prefix chrome only*/
@mixin progress(){
progress{-webkit-appearance: none;appearance: none;}
progress::-webkit-progress-bar{background:#0a2133;}
progress[value]::-webkit-progress-value {background:#961241;transition:all 0.2s linear}
progress{width:100%;height:3px;}
progress:after{content:attr(value)'/'attr(max);position:absolute;}
;
}@include progress()
;
/*local*/
progress.rt:after{top:0;right:0;}
let fn={}
fn.q=(d=>document.querySelector(d))
;
fn.q('[contenteditable]').oninput =function(ev){
fn.q('.f>progress').value=this.innerHTML.split('\n').length||1
}
;
Author And Source
この問題について(contenteditable within progress), 我々は、より多くの情報をここで見つけました https://qiita.com/HadaGunjyo/items/2a4e51187e29e83692c6著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .