kindeditor使用方法,kindeditor怎么设置长宽度

 时间:2026-02-18 12:42:01

1、首先我们需要kindeditor及其相关文件,这些文件可以去网上找,很容易找到。

kindeditor使用方法,kindeditor怎么设置长宽度

2、下载完成后会看到很多文件,但是我们只需要其中的三个主要文件,如下图,把这三个文件拷贝到你的项目中,不要忘记jQuery文件。

kindeditor使用方法,kindeditor怎么设置长宽度

kindeditor使用方法,kindeditor怎么设置长宽度

3、然后就是使用方法了,其实这个kindeditor就是把textare框美化了一下,添加了一些功能。所以在html中,我们需要有一个textare框,给它一个id。

kindeditor使用方法,kindeditor怎么设置长宽度

kindeditor使用方法,kindeditor怎么设置长宽度

4、之后我们需要引入jQuery及kindeditor的js文件,其它的文件kindeditor会自动调用,不必手动引用。然后在js中写相关的语句就可以了,如下图:

kindeditor使用方法,kindeditor怎么设置长宽度

kindeditor使用方法,kindeditor怎么设置长宽度

5、kindeditor的长度和宽度都可以通过参数来设置,其中width来设置宽度,最好用百分数,height来设置高度。

KindEditor.create('#editor_id',{allowImageUpload:false,resizeType : 1,width:"50%",height:"200px"});

kindeditor使用方法,kindeditor怎么设置长宽度

6、除了用参数设置kindeditor大小之外,我们看html源码还可以看到kindeditor大小由class为ke-container和ke-container-default所在的div控制,所以我们可以给ke-container和ke-container-default设置一个宽度和高度,要确保其优先级最高,所以加!important。

.ke-container.ke-container-default{

  width:600px!important;

  height:100px!important;

}

kindeditor使用方法,kindeditor怎么设置长宽度

kindeditor使用方法,kindeditor怎么设置长宽度

  • MongoDB 创建用户 修改密码 修改权限 删除用户
  • layui渲染表格怎么向后台传token
  • loadrunner录制时弹出invalid application path
  • 三七粉吃了有什么好处
  • 海尔XQG55-Q796洗衣机使用说明书
  • 热门搜索
    热血传奇怎么玩 漫长的近义词 寂寞的近义词 顾里发型 怎么压缩文件到最小 我的世界吊灯怎么做 买房贷款怎么算 大公无私的近义词 传真机怎么用 手机序列号怎么查