最佳答案
你应该看看
<div class="CodeMirror-gutters" style=" /*height: some_pixel*/; "><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 28px;"></div></div>
在按下回车或任何关键字后,它会自动设置行号的高度,而不是 some_pixel,
如果您在开始时遇到这个问题,您可能想先看看如何创建,
常用的方法有3种,
最简单的是定义您的文本区域并只使用此代码:
var YourCodeMirror = CodeMirror.fromTextArea(YourDefinedTextArea);
最好的方法是使用代码放置值:
var yourCodeMirror = CodeMirror(PlaceYouWant, {
value: /*any code here :*/"function(){return 'anything'}",
mode: /*your mode ie.*/"javascript"
});
希望对你有帮助
更新:这里有一个手册站点:http://codemirror.net/doc/manual.html
关于Css 在 codemirror 编辑器中无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19051431/