【发布时间】:2013-05-27 20:36:45
【问题描述】:
...问题总结...
工作示例
标题属性在图片上效果很好,for example
<img
src="http://imgs.xkcd.com/comics/the_general_problem.png"
title="I find that when someone's taking time to do something right in the present, they're a perfectionist with no ability to prioritize, whereas when someone took time to do something right in the past, they're a master artisan of great foresight."
alt="The General Problem"
>
问题(不起作用的示例)
我正在尝试嵌入 iframe 视频,例如当您在 YouTube 或(在本例中)SouthPark Studios 上点击“分享此视频”时
似乎:
- 我不知道与 iframe element 一起使用的正确 属性(它显然不是“标题”),或者
- “title”是正确的,但 iframe 以某种分层问题胜过它。见下文
...进一步阅读:我已经尝试过的详细信息...
第一次尝试:将其包裹在一个 div 中,并赋予 div 最大层
<div
title="South Park video about Ginger Kids coming in the night to carry off the town's other kids"
style="z-index: 2;"
>
<iframe
src="http://media.mtvnservices.com/embed/mgid:arc:video:southparkstudios.com:1feaa96c-ed01-11e0-aca6-0026b9414f30"
width="360"
height="293"
frameborder="0"
>
</iframe>
</div>
来源:
https://stackoverflow.com/a/7117107/1421642,用于 div
http://www.echoecho.com/csslayers.htm,用于层(z-index)
第二次尝试:将“title”放入 iframe 标签中
<iframe
title="South Park video about Ginger Kids coming in the night to carry off the town's other kids"
src="http://media.mtvnservices.com/embed/mgid:arc:video:southparkstudios.com:1feaa96c-ed01-11e0-aca6-0026b9414f30"
width="360"
height="293"
frameborder="0"
>
</iframe>
两次尝试的结果
在这两种情况下,我mouse over the iframe and nothing happens。将其与我一开始的“有效示例”代码进行比较,您可以在其中 mouse over and see a beautiful little popup
请帮忙:)
【问题讨论】: