<div contenteditable="true">
    -----
</div>

css主要属性

div {
    width: 100px;
    min-height: 100px;
    max-height: 300px;
    padding: 3px;
    border: 1px solid #a0b3d6;
    font-size: 12px;
    word-wrap: break-word;
    overflow-y: auto;
}