Force CKEditor to add a class to p-tags

前端 未结 3 928
青春惊慌失措
青春惊慌失措 2020-12-07 01:18

I must configure CKEditor to add a class-attribute to every p-tag in the content. You can do something similar with config.format_p but it will only apply the class-attribut

3条回答
  •  无人及你
    2020-12-07 01:59

    Well .. not sure if you need that for some specific reason .. but wouldn't life be much easier if you do what you want to do at the display end?

    Like if I display some text (saved from ckeditor) at the front end, display in something like a

    ...

    And all

     

    tags within it can be applied styles or applied jquery by the notation:

     .ckcontent p { margin-left:5px;........ }
    

    OR

     $('.ckcontent p').addClass('ckparagraphs');
    

提交回复
热议问题