Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在特定位置的图像上嵌入youtube视频_Php_Html_Youtube - Fatal编程技术网

Php 在特定位置的图像上嵌入youtube视频

Php 在特定位置的图像上嵌入youtube视频,php,html,youtube,Php,Html,Youtube,我的页面上有一张图片,我正试图在上面的特定位置嵌入一段youtube视频。我该怎么做?使用地图?你不能,你必须使用CSS位置:绝对;顶部:0px;左:0px;语法将其对齐,但需要将图像作为视频父元素的背景图像 <div style="background-image: url(image.jpg);"> <!--- embed youtube vid here with style="position: absolute; top: 0px; left: 0px; z-inde

我的页面上有一张图片,我正试图在上面的特定位置嵌入一段youtube视频。我该怎么做?使用地图?

你不能,你必须使用CSS位置:绝对;顶部:0px;左:0px;语法将其对齐,但需要将图像作为视频父元素的背景图像

<div style="background-image: url(image.jpg);">
<!--- embed youtube vid here with style="position: absolute; top: 0px; left: 0px; z-index: 100;" --->
</div>

这里可能有一个术语问题


不要考虑在图像中“嵌入”某些内容,而要考虑在视频周围环绕一个包含div的文件,并将所讨论的图像作为背景。然后只需使用CSS在div中定位视频。

或者,您可以使用html5版本的视频并使用海报属性:


你说在上面是什么意思?是的,我想把youtube上的zindex放在图片的顶部。