Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decrease the line height in ckeditor 4.4.5?

How can the default line-height be reduced on the ck-editor. It's little too high at the moment, since I have upgraded it to the version 4.4.5

Is there any property available to do this?

like image 561
Reema Avatar asked Apr 21 '26 01:04

Reema


1 Answers

Was upgrading ckeditor to 4.6.2 and ran across the same problem again. The problem was the line height was more when i pressed enter key to go to the next line. This time I found a new solution.

ckeditor adds <p> tags instead of <br> tags on clicking Enter. This is its default behaviour. We can change this to either <br> or <div> tags based on what is required.

There is a config.js file in the ckeditor library with the below code:

CKEDITOR.editorConfig = function( config ) {};

You can update this function with any of the below properties:

CKEDITOR.ENTER_DIV – new <div> blocks are created
CKEDITOR.ENTER_P – new <p> paragraphs are created
CKEDITOR.ENTER_BR – new <br> line breaks are created.

Example:

CKEDITOR.editorConfig = function( config ) { config.enterMode = CKEDITOR.ENTER_BR; };

like image 92
Reema Avatar answered Apr 22 '26 15:04

Reema