[SOLVED] CKEditor - override a style


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,



  • You must to post comments
Best Answer

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:

Hello World

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…

Thanks so much – I just need to set some css for the <p> tag within CKEditor…

  • You must to post comments

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:


Best regards

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.