安装了 CKEditor,发现它会导致行之间有很大的空间,即使只是按一次 Enter 移动到下一个!我必须为每个输入按“Shift”才能获得断线!如何在不按 Shift 的情况下使其达到按“Shift”的效果呢?
这是由于CKEditor默认enterMode和shiftEnterMode导致,需要修改配置:
enterMode=2
shiftEnterMode=1
forceEnterMode=false
例如:
<textarea type="text" name="comment" class="ckeditor" style="line-height:1px;"></textarea>
<script>
CKEDITOR.replace('comment',{height : 800,enterMode:2,forceEnterMode:false,shiftEnterMode:1});
</script>
原文链接:https://www.js1331.com/jiaocheng?id=279145