向锚点添加填充并在 post 文本编辑器中设置按钮样式
Add padding to anchors and style the buttons inside post text editor
我正在使用 CKEditor4 完整版对帖子内容进行格式化、样式化和添加媒体。
有时内容包含 link 到另一个页面的锚点,例如:
<a href="http://example.com/another-page">Another Page</a>
我可以使用 CKEditor 更改颜色、背景、字体等来设置锚的样式
但它看起来像这样:
_______________
| Another Page |
|______________|
这样背景就会把文字包裹起来。
如果我想添加一些内边距怎么办:
______________________
| |
| Another Page |
|______________________|
还有按钮,我无法设置它们的样式。
我知道这是一个文本编辑器,我可以编辑 html 代码,但是使用它的人不懂 HTML 或任何编程语言。
那么是否有我可以添加的插件、另一个版本或另一个提供此类功能以及插入媒体的文本编辑器?
as well as inserting media?
如果您希望使用 CKEditor 嵌入媒体,请参阅以下两个 link:
- https://sdk.ckeditor.com/samples/mediaembed.html
- https://ckeditor.com/docs/ckeditor4/latest/guide/dev_media_embed.html
Sometimes the content contains anchors to link to another page... So is there is a plugin I can add
您的要求很具体,因此我在这里看到两个解决方案
- 如果您希望为特定 link 添加特殊样式,您可以为此使用样式下拉列表 - https://sdk.ckeditor.com/samples/styles.html. Please simply prepare that style outside of the editor and then add is to
styles.js
file - https://ckeditor.com/docs/ckeditor4/latest/guide/dev_styles.html。您可以添加样式或 class 名称,但在第二种情况下,您需要将整个 class 定义添加到编辑器 contents.css
文件中。最后请注意,编辑器不会将 HTML 与外部 CSS 一起提交,因此您在 CKEditor 中使用的按钮 CSS class 也应该在将使用内容的页面上可用。
- 另一种选择是创建一个专用插件,它将插入特殊样式的 link 或按钮。此处描述了如何编写插件:https://ckeditor.com/docs/ckeditor4/latest/guide/plugin_sdk_sample_1.html
我正在使用 CKEditor4 完整版对帖子内容进行格式化、样式化和添加媒体。
有时内容包含 link 到另一个页面的锚点,例如:
<a href="http://example.com/another-page">Another Page</a>
我可以使用 CKEditor 更改颜色、背景、字体等来设置锚的样式
但它看起来像这样:
_______________
| Another Page |
|______________|
这样背景就会把文字包裹起来。
如果我想添加一些内边距怎么办:
______________________
| |
| Another Page |
|______________________|
还有按钮,我无法设置它们的样式。
我知道这是一个文本编辑器,我可以编辑 html 代码,但是使用它的人不懂 HTML 或任何编程语言。
那么是否有我可以添加的插件、另一个版本或另一个提供此类功能以及插入媒体的文本编辑器?
as well as inserting media?
如果您希望使用 CKEditor 嵌入媒体,请参阅以下两个 link:
- https://sdk.ckeditor.com/samples/mediaembed.html
- https://ckeditor.com/docs/ckeditor4/latest/guide/dev_media_embed.html
Sometimes the content contains anchors to link to another page... So is there is a plugin I can add
您的要求很具体,因此我在这里看到两个解决方案
- 如果您希望为特定 link 添加特殊样式,您可以为此使用样式下拉列表 - https://sdk.ckeditor.com/samples/styles.html. Please simply prepare that style outside of the editor and then add is to
styles.js
file - https://ckeditor.com/docs/ckeditor4/latest/guide/dev_styles.html。您可以添加样式或 class 名称,但在第二种情况下,您需要将整个 class 定义添加到编辑器contents.css
文件中。最后请注意,编辑器不会将 HTML 与外部 CSS 一起提交,因此您在 CKEditor 中使用的按钮 CSS class 也应该在将使用内容的页面上可用。 - 另一种选择是创建一个专用插件,它将插入特殊样式的 link 或按钮。此处描述了如何编写插件:https://ckeditor.com/docs/ckeditor4/latest/guide/plugin_sdk_sample_1.html