在全屏视频上放置文字(HTML5) [英] Put a text on fullscreen video (HTML5)

查看:743
本文介绍了在全屏视频上放置文字(HTML5)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将全文视频上的文字放在HTML上。

I want to put text on fullscreen video at HTML.

我可以将其设为非全屏,但不能在全屏上播放。

I could make it non fullscreen but it is not working on fullscreen.

有什么方法可以吗?

我使用 position:absoulute for文字和<$​​ c $ c>位置:相对/固定/无用于视频。

I use position:absoulute for text and position:relative/fixed/none for video.

此外我不知道它是否有效但是我为浏览器调用了 .requestFullscreen(); 函数,我无法调整视频大小。

Also I don't know if it works but I called .requestFullscreen(); function for browser unhappily I cannot resize video.

如果 .requestFullscreen(); 是有效的。我需要调整视频大小。

If .requestFullscreen(); is works. I need to resize video.

视频标签的宽度和高度正在变化,但视频没有变化。

width and height of video tags is changing but video is not changing.

推荐答案

我找到了解决方案。
这完全是关于z-index的。
这是css:

I found the solution. It was all about z-index. This is the css:

#video{ position: relative; }
#text{  position: absolute; z-index: 2147483647;
} 

感谢您的回答。

这篇关于在全屏视频上放置文字(HTML5)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆