如何摆脱CKEditor中的大间距? [英] How to Rid of Large Spacing in CKEditor?

查看:1076
本文介绍了如何摆脱CKEditor中的大间距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

>

CKEditor,我发现它导致线之间的大空间,即使我只是按回车一次移动到下一个!我必须按Shift每个输入有断裂线!有关如何使其无需按Shift键的工作的任何想法?

I installed CKEditor, i found it causes large space between lines even though i'm just pressing enter once to move to the next! I have to press "Shift" for every enter to have the breakline! Any idea on how to make it work without pressing Shift?

由按Shift + Enter引起的第2行。
第3行由于只需按Enter。

Line 2 caused by pressing Shift + enter. Line 3 caused by just pressing Enter.

我使用PHP

推荐答案

您可以在config.js中设置使用< br> 而不是< p> ,同时按ENTER键:

You can set in your config.js to use a <br> instead of <p> while hitting the ENTER key:

config.enterMode = CKEDITOR.ENTER_BR;

可用的标志是

CKEDITOR.ENTER_P (1) – new <p> paragraphs are created;
CKEDITOR.ENTER_BR (2) – lines are broken with <br> elements;
CKEDITOR.ENTER_DIV (3) – new <div> blocks are created.

查看文档enterMode 了解更多详情

展开Josepth Silber的回答(他知道删除..他建议使用 config.autoParagraph = false; ),IIRC(手册不是真正清楚什么创建包含在内联内容意味着), autoParagraph config添加< p>< / p& code>在每个内联内容的正文内。因此,即使您在空行上按Enter键,也会生成< p>< / p> (或< p& ; nbsp;< / p> ,如果这样配置)。手动建议保留该选项,尽管(所以设置为 true );

Expanding on Josepth Silber answer (that he know deleted.. He suggested using config.autoParagraph = false; ), IIRC (the Manual is not really clear on what create wrapping blocks around inline contents means), the autoParagraph config adds a <p></p> pair around each inline content inside the body. So, even if you hit Enter on an empty line, it will generate <p></p> (or <p>&nbsp;</p>, if so configured). The manual suggest leaving that option as it is, though (so set to true);

这篇关于如何摆脱CKEditor中的大间距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆