You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为YouTube的iframe标签添加父级div类?

为YouTube的iframe添加带类名的父级div容器

只需将原iframe标签包裹在带有指定类名的<div>标签内即可完成修改,具体代码如下:

原始代码

<iframe width="480" height="270" src="https://www.youtube.com/">
</iframe>

修改后的代码

<div class="video-class">
<iframe width="480" height="270" src="https://www.youtube.com/">
</iframe>
</div>

内容的提问来源于stack exchange,提问作者Faiq Adam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 00:47:02