element.contentEditable - JSFiddle

ようわからん

HTML

<div class="editable" contenteditable="true">
  
  <div>
  <img>
  test<br>
  </div>
  
</div>

CSS

div.editable {
  background-color: #fff;
  width: 300px;
  height: 100px;
}
.editable img {
  background-image: url(https://www.mozilla.org/media/img/logos/firefox/logo-small.a51e16fdce01.png); 
  background-repeat: no-repeat;
  background-size: contain;
  background-position: 0 20px;
  padding: 20px;
  margin: 2px;
}