Tinymce 4富文本设置行高

由于是Tinymce 4 对于line height 这个插件不支持,只要版本5以上才可以,所以只能通过重新style的方法去实现,

添加 toolbar  styleselect

重写 style,添加设置
​​​​​​​style_formats: [
   {title: "Line Height", items: [
         {title: '1', block: 'p', styles: {'line-height': '1.0'}},
         {title: '1.5', block: 'p', styles: {'line-height':'1.5'}},
         {title: '1.75', block: 'p', styles: {'line-height': '1.75'}},
         {title: '2', block: 'p', styles: {'line-height': '2'}},
         {title: '3', block: 'p', styles: {'line-height': '3'} },
         {title: '4', block: 'p', styles: {'line-height': '4'}},
         {title: '5', block: 'p', styles: {'line-height': '5'}},
      ]},
],
	style_formats_merge: true,
	style_formats_autohide: true,

style_formats_merge此选项使您可以设置TinyMCE是将style_formats设置中的样式附加到默认样式格式还是完全替换它们。

true为附加

style_formats_autohide(隐藏当前不可用的样式列表)

 

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值