How to change textarea, height or number of lines?


#1

hi

I need to extend the textarea height, or increase number of lines within.
Anyone knows how to do that?

Also, I need to change the font size within the textarea, any help?


#2

Use CSS.

.CodeMirror {
  font-family: "Ubuntu Mono";
  line-height: 1.2em;
  height: 3.6em;
}

If you do this on a running editor (for example by changing DOM style objects), you’ll have to call the editor’s refresh method afterwards so that it can adjust to its new style.


#3

Thank you! It works. It surprises me that, no API supports me to do that.


#4

Thanks a lot. It does works. I have spent too much time on this problem.