我的 ckeditor WYSIWYG 可以选择创建 div。我正在尝试创建一种可以放在“样式”下拉列表中的样式:
我试过将以下内容添加到我的 config.js 中,但似乎没有效果。
CKEDITOR.stylesSet.add( 'default',
[
// Inline styles
{ name : 'Titulo Explicacion Servicio', element : 'div', attributes : { 'class' : 'titulo_explicacion_servicio' } },
{ name : 'Texto Explicacion Servicio', element : 'div', attributes : { 'class' : 'texto_explicacion_servicio' } },
{ name : 'Texto Fondo Foto', element : 'div', attributes : { 'class' : 'intro_fondo_foto' } }
]);
我怀疑这有什么不同,但这是针对 Drupal 站点的。
最佳答案
我在styles.js 中找到了我需要更改的内容
CKEDITOR.stylesSet.add( 'default', [
{ name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
{ name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
{
name: 'Image caption', //THESE NEXT 4 LINES I CHANGED
element: 'div',
attributes: {
class: 'caption-mine'
}
},
关于ckeditor - 在ckeditor中创建可以应用于div的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18210839/