2016-06-12 7 views
0

HTMLtextareaがあります。要素については、とcodemirror.cssのモジュール(CodeMirror)を使用しています。CodeMirrorモジュールを使用しているときにHTMLテキストエリアのサイズを変更できません

<md-content flex style="display: flex; flex-flow: column;"> 
    <textarea id="textArea" style="flex:1"></textarea> 
</md-content> 

個別のJavaScriptファイルを使用してモジュールを操作します。

var textArea = document.getElementById('textArea'); 
CodeMirror.fromTextArea(textArea, { 
    lineNumbers: true 
}); 

Iブラウザテキスト領域でこれを開き、自動的にウィンドウ内で水平に充填されなく垂直方向(幅:100%&高さ:50%)されています。 <style>を追加し、幅と高さを設定しようとしました。しかし、それは何も変わりません。

<textarea id="textArea" style="flex:1; width:200px; height:300px"></textarea> 

また、JavaScriptを使用してCSSを変更しようとしましたが、再び要素のサイズは変更されませんでした。

textArea.style.width = 200; 
textArea.style.height = 300; 

私はflex:1を使用している理由です、<textarea><md-content>以内に充填されることを望んでいました。親タグの領域(親と同じサイズ、md-content)を満たすようにサイズを変更するにはどうすればいいですか?

これはcomplete code

+0

あなたはフィドルを追加できますか? – Roysh

+0

どうすれば追加できますか? – CoderS

+0

https://jsfiddle.net – Roysh

答えて

2

https://jsfiddle.net/e86pztkh/1/

.CodeMirror { 
    position: relative !important; 
    height: 100% !important; 
} 
html, body{ 
    min-height: 100%; 
    position: relative; 
    height: 100%; 

}

ないあなたはそれを修正して!重要な宣言をダンプしない場合は、ローカルcodemirror CSSファイルを持っている場合は必ずあります。

関連する問題