在 TinyMce 中保持嵌入视频的正确大小 [英] Keep correct size of embed video in TinyMce

查看:19
本文介绍了在 TinyMce 中保持嵌入视频的正确大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用媒体插件在 TinyMce 中添加嵌入媒体.例如,当我添加具有特定大小值的嵌入视频时,当我保存帖子时,宽度不正确.创建了以下 HTML:

I want to add embed media in TinyMce with media plugin. When I add an embed video for example with specific size value, when I save the post, the width is not correct. The following HTML is created:

<iframe src="//www.youtube.com/embed/XlpTLDulFe8" width="100" height="100" allowfullscreen="allowfullscreen"></iframe>

但不幸的是,我有以下 CSS (mdl CSS) 重载了我的宽度大小:

But infortunatly, i've the folowing CSS (mdl CSS) that overload my width-size:

iframe {
    display: block;
    width: 100%;
    border: none;
}

我想使用 max-width:100%; 来保持 iFrame 宽度,如果它不优于 100%

I want to use instead a max-width:100%; for keep iFrame width if it isn't superior to 100%

如何禁用由 TinyMce 创建的 iFrame 的宽度属性?我试图获取用于删除属性的 HtmlElement 并设置另一个但没有成功.

How can I disable the width property for iFrame created by TinyMce ? I've tried to get the HtmlElement for remove property and set another but without success.

推荐答案

我找到了解决我的问题的方法,这不是一个聪明的方法,但它仍然有效.我将css属性应用于