TinyMCE:覆盖样式表中定义的粗体和斜体
考虑以下示例
编辑器 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只是想将
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 tofont-weight:normal;
为了解决这个问题,我们将字体样式(粗体、斜体)从 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.