qadenza
qadenza

Reputation: 9293

how to set height of tinymce textarea

cannot set the height of tinymce textarea. According to documentation, it should be the same as the height of the original replaced textarea, in my case - 500px.

tinymce.init({
    selector: "#texedit",
    body_class: 'tiny01',
    content_css: "content.css",
});

content.css

.tiny01{
    background:lightgreen;
    overflow-y:scroll;
    height:500px;  // deosn't work
}

#texedit{
    height:500px;  // deosn't work
}

main.css

#texedit{
    height:500px;  // deosn't work
}

texedit is not 500px but about 100px height.

Upvotes: 0

Views: 4408

Answers (2)

Monkey_Dev1400
Monkey_Dev1400

Reputation: 944

in your css file add your id and assign a height

tinymce.init({
  selector: "#mytextarea"
});
#mytextarea {
  height: 700px;
  /*edit this*/
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/tinymce/4.1.2/tinymce.min.js">
</script>
<textarea id="mytextarea">Congratulations!</textarea>

Upvotes: 1

Blake Connally
Blake Connally

Reputation: 689

You need to set this value in the init call.

tinymce.init({
    selector: "#texedit",
    body_class: 'tiny01',
    content_css: "content.css",
    height: "500"
});

Upvotes: 2

Related Questions