使用 TinyMCE 修改图像的“clear”属性

发布于 2024-08-22 05:55:58 字数 155 浏览 4 评论 0原文

我在 Django 网站中使用 TinyMCE 和 tinymce-django 应用程序。我在管理界面中使用它来编辑 HTML 字段。 (类似于平面页面。)

使用 TinyMCE 添加图像时,如何更改其 clear 样式属性?

I'm using TinyMCE with the tinymce-django app in my Django website. I am using it in the admin interface to edit HTML fields. (Something like a flatpage.)

When adding images with TinyMCE, how can I change their clear style attribute?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

亚希 2024-08-29 05:55:58

首先转到图像弹出窗口。选择图像后,导航到外观选项卡。

如果您没有看到此弹出窗口,请确保编辑器模式为高级并且包含插件advimage

现在,您有两个选择:

  1. CSS 类。例如,您必须定义 .clear {clear: Both; }
    在你的 CSS 样式表中。在 TinyMCE 中,您将看到该类,选择清除
    如果您没有看到您的类,可能是因为您没有在 content_css 中包含样式表,但您仍然可以选择 (value) 并自行键入。
  2. CSS 样式。在样式行中添加clear:both;(或右/左,无论您需要什么)。

我已经对这两个选项进行了屏幕截图,您只需要其中一个:

TinyMCE 外观选项卡

可以在HTML 弹出窗口中手动编辑样式。如果编辑器是为开发人员设计的,那么这是最简单的方法,而且可能也是最快的方法。

First go to the image popup. After selecting image, navigate to Appearance tab.

If you don't see this popup, make sure that the editor mode is advanced and the plugin advimage is included.

Now, you have two options to do so:

  1. CSS class. You have to define, for example, .clear { clear: both; }
    in your CSS stylesheet. In TinyMCE you will see the class, select clear.
    If you don't see your class that's probably because you didn't include the stylesheet in content_css, but you can still select (value) and type it yourself.
  2. CSS style. Add clear: both; (or right/left, whatever you need), in the style row.

I've made an screenshot of both options, you need only one of them:

TinyMCE Appearance tab

It is possible to edit the style manually, in HTML popup. If the editor is intended for developers, then this is the easist approach, and probably also the fastest one.

笑梦风尘 2024-08-29 05:55:58

您需要明确包含在 有效元素 规则中(或扩展有效元素),否则 TinyMCE 会将其删除。

You need to have clear included in the valid elements rules (or the extended valid elements), or TinyMCE will strip it out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文