<div contenteditable=true>
  edit me
</div>
div[contenteditable] {
  width:200px;
  border:1px solid;
  font-size:25px;
  line-height:1.2em;
  background:
    linear-gradient(red,red)       0 0/1px max(0px,100% - 6*1.2em),
    linear-gradient(yellow,yellow) 0 0/1px max(0px,100% - 3*1.2em);
}
/*
 I am using "linear-gradient(X,X) instead of "linear-gradient(X 0 0)" 
 for better browser support "
*/

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.