CKEditor - override a style

0
0

Hello – I’m trying to overide the style for margin on <p> tags within the CKEditor (when editing – and you press enter it inserts a <p>).

I want no space to the next line when you press enter. CKEditor documentation says to set a css style of margin = 0 for the <p> tag. Fine.

I’m trying to get this done using .Eval – here is my (vb.net) code:

ckEditor.Eval(“this.getContentElement().setStyles(“”p {margin : 0; }””)”)

I think the above – or something very similar to it – should work.  I probably have the syntax wrong.

Any insight?

 

Thanks in advance,

 

Matthew

  • You must to post comments
0
0

Hi Frank – when using the CKEditor as a user (i.e. editing a document) if you press the [Enter] key and then type “Hello World’, CKEditor inserts this:

<p>
Hello World
</p>

Which is fine. However the margins on the <p> tag in their style sheet Give you more spacing down to the next paragraph than my client wants.

My client gets this, when pressing enter once:

Hello World 1

Hello World 2

What my client wants is this:

Hello World 1
Hello World 2

So basically come down one “line” when pressing enter.

CKEditor documentation says to set the margin to zero for the <p> tag. That is what I’m trying to address here…

https://ckeditor.com/docs/ckeditor4/latest/guide/dev_best_practices.html#use-enter-mode-p
Thanks so much – I just need to set some css for the <p> tag within CKEditor…

  • You must to post comments
0
0

Hi Matthew,

can you please be a bit more precise of what you are trying to achieve?
What space do you want to be suppressed ?

Generic infos about configuring the content area can be found e.g. here:

https://ckeditor.com/old/forums/CKEditor-3.x/CSS-style-sheet-for-content-area

Best regards
Frank

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.