Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在编辑器中设置默认图像样式_Css_Ckeditor_Ckfinder - Fatal编程技术网

Css 在编辑器中设置默认图像样式

Css 在编辑器中设置默认图像样式,css,ckeditor,ckfinder,Css,Ckeditor,Ckfinder,我正在自定义CMS中使用CKEditor和CKFinder。用户在文章中上传和插入照片,效果非常好。缺点是默认的图像样式是边距/填充:0px,因此在左对齐或右对齐时,图像看起来很拥挤 有没有办法在CKEditor中设置默认图像样式,以便在用户插入图像时(无论是通过CKFinder还是输入direct HTML/Source),都会添加padding:10px属性作为样式 您可以在此编辑器中设置样式 我个人使用contentsCss配置选项提供样式表引用,如下所示: CKEDITOR.edito

我正在自定义CMS中使用CKEditor和CKFinder。用户在文章中上传和插入照片,效果非常好。缺点是默认的图像样式是边距/填充:0px,因此在左对齐或右对齐时,图像看起来很拥挤


有没有办法在CKEditor中设置默认图像样式,以便在用户插入图像时(无论是通过CKFinder还是输入direct HTML/Source),都会添加padding:10px属性作为样式

您可以在此编辑器中设置样式

我个人使用contentsCss配置选项提供样式表引用,如下所示:

CKEDITOR.editorConfig = function(config) {
    config.contentsCss = ['styles.css'];
};
在styles.css中,您可以执行以下操作:

img { margin: 10px; }

或者您想对图像执行的任何操作。

您可以在此编辑器中设置样式

我个人使用contentsCss配置选项提供样式表引用,如下所示:

CKEDITOR.editorConfig = function(config) {
    config.contentsCss = ['styles.css'];
};
在styles.css中,您可以执行以下操作:

img { margin: 10px; }
或者你想为图像做什么