【问题标题】:Entering HTML text into an iframe在 iframe 中输入 HTML 文本
【发布时间】:2013-05-22 19:48:38
【问题描述】:

是否可以在 iframe 中添加“子文本”?例如我有以下代码...

<iframe class="musicsamples" width="80%" height="315" src="http://www.youtube.com/embed/apkRBANIKxc" frameborder="0" allowfullscreen></iframe>

    <iframe class="musicsamples" width="80%" height="315" src="http://www.youtube.com/embed/h7ArUgxtlJs" frameborder="0" allowfullscreen></iframe>

我希望能够在下面添加一些文字,详细解释视频等,但每当我使用简单的

标签在 iframe 内或外边,它会将其视为 iframe 不存在,并且文本始终显示在页面顶部而不是 iframe 下方。也许我需要以除 iframe 之外的其他方式嵌入此视频,以便能够与它一起使用文本?

【问题讨论】:

    标签: html iframe video text


    【解决方案1】:

    我不确定什么不适合你,也许你的 CSS 搞砸了?

    我能够使用视频的 iframe 并向它们添加一些描述。这是一个示例,它也在jsFiddle

    <div>
        <iframe class="musicsamples" width="80%" height="315" src="http://www.youtube.com/embed/apkRBANIKxc" frameborder="0" allowfullscreen></iframe>
        <p>Pharoahe Monch Simon Says (Avicii Remix)</p>
    </div>
    
    <div>
        <iframe class="musicsamples" width="80%" height="315" src="http://www.youtube.com/embed/h7ArUgxtlJs" frameborder="0" allowfullscreen></iframe>
        <p>deadmau5 feat. Rob Swire - Ghosts N Stuff</p>
    </div>
    

    【讨论】:

    • 我最终弄明白了(我以前从未使用过 jsFiddle,但这绝对有帮助。我最终发现我的类 .musicsamples 浮动到左侧,导致所有文本出现在顶部未格式化。谢谢 janka!
    猜你喜欢
    • 2018-03-22
    • 2015-03-14
    • 2010-11-07
    • 2017-03-27
    • 2010-09-23
    • 1970-01-01
    • 2012-03-01
    • 2018-04-19
    相关资源
    最近更新 更多