How to set text align and indentation in codemirror editor as it always start in the middle?

Viewed 1590

I have problems using CodeMirror. When I typed my codes in the textarea, it will start in the middle and not at the most left even after going to next line. Must I modify the CSS?

JSP:

<script>
var editor = CodeMirror.fromTextArea(document.getElementById("myTextArea"), {
mode:"javascript",
lineNumbers: true,
autofocus: true
});
editor.setSize(500,680);
</script>

https://i.stack.imgur.com/wvhVZ.jpg

2 Answers

Even I was facing a similar issue then I found out that my Parent Style-sheet had an command text-align: center

I did not have text-align: center within my Child style sheet. So better check if there are any elements which have the styles text-align: center if so remove all then check.

Related