开发者

ckeditor class on paragraph is not being recognized

开发者 https://www.devze.com 2023-02-06 04:39 出处:网络
Good day to all. I nee开发者_JS百科d to put a class on paragraph tags in ckeditor. Inside config.js I added:

Good day to all. I nee开发者_JS百科d to put a class on paragraph tags in ckeditor. Inside config.js I added:

...

config.format_p = { element : 'p', attributes : { class : 'whatever' } };  

...

as in http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.format_p.

The problem is that the class is not being recognized (paragraphs still don't have any class). Can anyone help pls?


You might need to be more specific with your styling. If the paragraphs are inside a div named foo such as..

<div id="foo">
    <p class="bar">paragraph text</p>
    <p class="bar">paragraph text</p>
</div>

Then declare your style in the css file as (sample style declarations given)

#foo p.bar {
   color: #f3f3f3;
   font-weight: bold;
}

It helps to target the paragraphs where they are respective to the DOM to get the desired results. I hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消