1225
Views
12
Comments
[CKEditor] How to reduce the spacing between 2 lines in ckeditor?
Question
ckeditor
Web icon
Forge asset by CKEditor Team

Hello,

I am using CKEditor and found that there is too much space between 2 lines.

Can we reduce the space between 2 lines?

Please advice.

Thanks and Regards,

Suraj Borade

2023-03-02 12-04-41
Márcio Lima

Hi Suraj,


Yes you can. Just edit the CSS of the paragraph for the component editor.


Best regards,

Márcio Lima

2018-11-06 14-26-44
Suraj Borade

Márcio Lima wrote:

Hi Suraj,


Yes you can. Just edit the CSS of the paragraph for the component editor.


Best regards,

Márcio Lima


Hi Marcio,

Are you suggesting that I should open CK Editor and edit hiss CSS? Or can I add this css in application which is consuming the CKEditor?

Thanks

2018-08-26 20-34-32
Pankaj pant

Suraj Borade wrote:

Hello,

I am using CKEditor and found that there is too much space between 2 lines.

Can we reduce the space between 2 lines?

Please advice.

Thanks and Regards,

Suraj Borade


Hi Suraj,

use the below code it will work.

SyntaxEditor Code Snippet

p {
    margin: 0;
}


Regards,

Pankaj

2022-07-07 18-45-50
Niels Favreau

Did you try shift-enter instead of enter when trying a new line?

2023-03-02 12-04-41
Márcio Lima

Niels Favreau wrote:

Did you try shift-enter instead of enter when trying a new line?

Hey Niels,

That's kind of a weird suggestion. :)

"Hey users, just press shift when writing a new paragraph."


2022-07-07 18-45-50
Niels Favreau

Márcio Lima wrote:

Niels Favreau wrote:

Did you try shift-enter instead of enter when trying a new line?

Hey Niels,

That's kind of a weird suggestion. :)

"Hey users, just press shift when writing a new paragraph."


True, was just trying to say that there are 2 different types of 'Enters'


2018-11-06 14-26-44
Suraj Borade

Niels Favreau wrote:

Márcio Lima wrote:

Niels Favreau wrote:

Did you try shift-enter instead of enter when trying a new line?

Hey Niels,

That's kind of a weird suggestion. :)

"Hey users, just press shift when writing a new paragraph."


True, was just trying to say that there are 2 different types of 'Enters'


Shift + Enter works fine but I cannot recommend this to users.


2018-11-06 14-26-44
Suraj Borade

Where to add this?

2023-03-02 12-04-41
Márcio Lima

Suraj,

Just change content.css that I've attached at the CKEditor resources.

I've added the paragraph margin:

p
{
    margin:2px;
}



contents.css
2018-11-06 14-26-44
Suraj Borade

Thanks Marcio. I will give it a try.

2023-03-02 12-04-41
Márcio Lima

You're welcome. 

Just make sure you clear your browser cache, otherwise you might be served the old version of the file.

2022-11-02 07-18-33
Nicholas Campbell

I realise this is a very old thread, but I noticed that this fixes the display in the editor, but the HTML behind the scened remains unchanged which is an issue because when I view/use that HTML elsewhere the big gaps are back.

The issue I am having is that I am copying content from Word into the editor and it is messing with the styling and one of the issues is this spacing. In Word it is small, then I copy here anx it is big. This fix makes it look small again, but when I use a software to put the HTML source back into Word, it then puts it as big spaces into Word again which an issue for users.

Is there a way to fix this altogether rather than just visually? @Márcio Lima 

I am having a few other formatting issues also that I have raised in a separate post here.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.