CKEditor 动态设置文本区域边距

CKEditor set textarea margin dynamically

我在 CKEditor 中设置每个动态模板的边距时遇到问题。现在我正在做的是直接进入 content.css

我的问题是如何直接从 php 模块设置保证金。

这是我的content.css我是直击

body
{
    /* Font */
    font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
    font-size: 12px;

    /* Text color */
    color: #333;

    /* Remove the background color to make it transparent */
    background-color: #fff;

    /*margin: 113px 94px 151px 113px; */
    margin: 3cm 2.5cm 4cm 3cm;
}

谢谢, 亨德拉

在你的 ckeditor textarea/div 之外创建一个 div 并给外部 div 留出空间 div。

<div id = "ckeContainer">
    <textarea name="editor1">This textarea is used for CKeditor</textarea>
</div>

<script>
    document.getElementById('ckeContainer').style.margin="3px 2px 3px 4px";
</script>

编辑

您也可以尝试以下 Javascript:

document.body.style.margin = "3px 2px 3px 4px";

希望对您有所帮助!