How to set CKEditor 5 height

  • Tech Area
  • April 24, 2023


I am using CKEditor 5 in one of my project. I already implemented this but I want to increase the height of ckeditor 5. How do I change the height of CKEditor 5?

<html>  
<head>  
<title>Ckeditor5</title>  
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
</head>
<style>
 .box
 {
  width:100%;
  max-width:600px;
  background-color:#f9f9f9;
  border:1px solid #ccc;
  border-radius:5px;
  padding:16px;
  margin:0 auto;
 }
</style>
<body>
<div class="container">
  <h3 align="center">CKEditor5</h3>
  <div class="box">
  <form method="post">
  <div class="form-group">
  <textarea id="content" name="content" class="form-control"></textarea>
  </div>
  <div class="form-group">
  <input type="submit" name="submit" value="Save" class="btn btn-primary">
  </div>
  </form>
 </div>
</div> 
</body>  
</html>  

<script src="https://cdn.ckeditor.com/ckeditor5/36.0.1/classic/ckeditor.js"></script>
<script>
    ClassicEditor
        .create( document.querySelector( '#content' ))
        .then(editor => {
          console.log(editor);
        })
        .catch( error => {
            console.error( error );
        });
</script>

Solution

CKEditor 5 height can be easily controlled with CSS.

.ck-editor__editable[role="textbox"] {
               min-height: 300px;
            }


Subscribe us via Email

Join 10,000+ subscriber

Subscribe on YouTube