上图
控件的设置
<asp:TextBox ID="FileContent" runat="server" TextMode="MultiLine" Rows="40" Columns="100" />JS的设置
var editor = CodeMirror.fromTextArea(document.getElementById("<%=FileContent.ClientID %>"), {
mode: "text/html",
tabMode: "indent",
width: '100%',
height: '100%',
autoMatchParens: true,
textWrapping: true,
lineNumbers: true
});
控件的设置
<asp:TextBox ID="FileContent" runat="server" TextMode="MultiLine" Rows="40" Columns="100" />JS的设置
var editor = CodeMirror.fromTextArea(document.getElementById("<%=FileContent.ClientID %>"), {
mode: "text/html",
tabMode: "indent",
width: '100%',
height: '100%',
autoMatchParens: true,
textWrapping: true,
lineNumbers: true
});
++如果这样还不行,那就改插件参数试试
width: '300px',
height: '500px',
overflow: auto;
height: 440px;
width:680px;
/* This is needed to prevent an IE[67] bug where the scrolled content
is visible outside of the scrolling box. */
position: relative;
outline: none;
}
再试试
width: '300',
height: '500',
或者
width: '60%',
height: '60%',
这样的参数设置
我也是和lz一样,修改的codemirror.css才生效。
在codemirror中的定义是.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
}
在你自己中设置成.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: auto;
}这样就可以改变了.另外要注意的是,你的css文件引入要放在后面, 也就是要覆盖codemirror.css中的规则