CKeditor自定义样式下拉 - 浮动
问题描述:
我正在使用CKEditor版本4.我正在制作自定义样式。问题是,当在下拉列表中显示的样式,与浮动任何样式:向右移动在这样的屏幕上:CKeditor自定义样式下拉 - 浮动
Item 1
Item 2
FLoat right item
Normal Item
我一直在试图重写样式,但它不工作。它们是用JavaScript动态创建的,我甚至不确定类名是如何影响这个的。
任何人都知道我可以解决这个问题吗?
我的风格的代码是这样的:
{ name: 'Image 25% Right', element: 'span', attributes: { 'class': 'img_right_25' } },
{ name: 'Image 25% Left', element: 'span', attributes: { 'class': 'img_left_25' } },
{ name: 'Image 50% Right', element: 'span', attributes: { 'class': 'img_right_50' } },
{ name: 'Image 50% Left', element: 'span', attributes: { 'class': 'img_left_50' } },
然后
.img_right_25 {
float:right;
margin-left:10px;
}
.img_left_25 {
float:left;
margin-right:10px
}
答
在editor.css,尝试添加这样一个规则:
.cke_panel_listItem * {
float:none !important;
}
然后刷新该页面(确保editor.css的旧内容未被缓存使用!)。
这是试图做什么(我没有测试过)是强制.cke_panel_listItem
下的每个后代元素的浮点值为“无”。 !important
应确保此规则不能被后续样式定义覆盖,因此JS所做的样式被忽略。
我认为contents.css也可能工作,但不知何故,我更喜欢这是在editor.css。 – Nenotlep 2014-10-21 05:08:52