TinyMCE:覆盖样式表中定义的粗体和斜体

发布于 2024-11-30 07:03:30 字数 322 浏览 1 评论 0原文

考虑以下示例

编辑器 css:

.heading{
    font-size: 20pt;
    font-weight: bold;
    font-style: italic;
}

HTML:

<div class="heading"> This is main heading </div>

当我尝试从标题 div 内的整个文本中删除粗体时,它不会将其转换为普通文本。这可能是因为标题类中定义的字体粗细。有没有办法在这种情况下切换字体粗细?

Consider the following example

editor css:

.heading{
    font-size: 20pt;
    font-weight: bold;
    font-style: italic;
}

HTML:

<div class="heading"> This is main heading </div>

When I try to remove the bold from whole whole text inside the heading div it won't convert it to normal text. This might be because of the font-weight defined in heading class. Is there a way to toggle the font-weight for such cases?

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

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

发布评论

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

评论(2

禾厶谷欠 2024-12-07 07:03:30

您只是想将 font-weight 更改回正常吗?如果是这样,只需删除该行 CSS,或将属性设置为 font-weight:normal;

Are you just trying to change the font-weight back to normal? If so, just delete that line of CSS, or set the property to font-weight:normal;

蓝颜夕 2024-12-07 07:03:30

为了解决这个问题,我们将字体样式(粗体、斜体)从 CSS 中移出,并直接在内容中使用 标签。这似乎是执行此操作的唯一正确方法。

To get ride of this issue we moved font styling (bold, italic) out from CSS and used the <strong> and <i> tags directly into the content. This seems to be only proper way to do this.

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