将 YouTube 视频与图像重叠
我只是想知道是否可以将 YouTube 视频(实际的视频播放器)与图像重叠。我想做的是让它看起来像有两只手握住 YouTube 视频,一只左手,一只右手。我认为这是一个简单的 CSS 事情,但不确定,因为我在网上找不到任何东西(我发现的只是图像重叠图像和淡入淡出)。无论如何,任何帮助将不胜感激。谢谢!
I just wanted to know if it was possible to overlap a YouTube video (the actual video player) with an image. What I want to do is make it look like there are two hands gripping the YouTube video, one left and one right. I figured it's a simple CSS thing, but wasn't sure since I couldn't find anything online (all I found was images overlapping images and fading in and out). Anyway, any help would be appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 iframe 方法并将
?wmode=opaque
添加到视频 URL 的末尾。例子:
use the iframe method and add
?wmode=opaque
to the end of the URL of the video.example:
您可以将 YouTube 嵌入脚本添加到页面中的 div 中,然后使用 CSS 将该 div 的位置设置为相对位置,现在在包含 YouTube 视频的 div 中放置另一个 div 并将该 div 设置为绝对位置,现在您可以确定您希望图像出现在页面上的哪个位置,其边界区域将由相对的 div 位置定义。
这是一个示例:
您的 CSS 可能类似于以下内容:
希望这会有所帮助!
You could add the YouTube embedded script into a div in the page, then with CSS set the position of that div to relative, now place another div inside of the div that contains the YouTube video and set that div to position absolute, now you can determine where on the page you want you image to appear and it's bounding areas will be defined by the relative divs position.
Here is an example:
Your CSS could look similar to the following:
Hope this helps!