Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CKeditor changing font format automatically

If I write something (example TEST1 and TEST2)in ckeditor, and retrive it, the font are displayed as following The only format I applied is bold.

TEST1

TEST2

By removing the format (clear format), it is cleared. But why does this happen? Why Ckeditor adds formatting on its own

<div><p style="font-size: 13px;"><u><strong> Test 1</strong></u></p>

<p style="font-size: 13px;">blah blah blah</p>

<u style="line-height: 1.6em;"><strong>Test 2</strong></u>

<p>blah blah blah</p>

I only added the bold style.The font size 13 px is not added by me.Ckeditor automatically adds it. Is there a way to remove the auto formatting by Ckeditor?

like image 250
Santosh Avatar asked Aug 14 '26 19:08

Santosh


1 Answers

my default font is 18px. But why did the ckeditor added font-size:13px is puzzling me

If your default font is 18 px then the pasted text of 13px will appear small and if the default font size is 10 px then the pasted text will appear big.

So your best option is to change the default font size in ckeditor contents.css . It will be located in your ckeditor folder.

 .cke_editable
    {
        font-size: 13px;
        line-height: 1.6em;
    }

Change the font-size to your default font size.

 .cke_editable
    {
        font-size: 18px;
        line-height: 1.6em;
    }

So all your font will be default set to 18 px.

like image 116
Moz Avatar answered Aug 17 '26 10:08

Moz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!