2012-03-03 63 views
0

傻看來,卻無法得到這個工作:ckeditor - 如何獲得自定義CSS與ID工作?

css (custom.css): 
==== 
#thePage h2 {color:#f00;} 

the ck-config, in container-html: 
================================= 
... 
//<![CDATA[ 
CKEDITOR.replace('editor1',{ 
    bodyId : 'thePage', 
    contentsCss : 'custom.css', 
    ... 

如果#thePage被刪除它的工作原理,但需要爲宗旨ID。我在這裏錯過了什麼?

問候/噸

回答

0

出於某種原因,bodyId似乎需要定期JS,

<script type="text/javascript"> 
if (window.CKEDITOR) { 
window.CKEDITOR.config.bodyId = 'thePage'; 
} 
</script> 

而且瀏覽器的緩存可以是一個痛苦..

問候,