如何将视频标签定位在固定位置?(How do I position a video tag in a fixed position?)

编程入门 行业动态 更新时间:2024-10-10 14:25:27
如何将视频标签定位在固定位置?(How do I position a video tag in a fixed position?)

我有以下视频标签:

<video width="640" height="480" controls id="mainVideo" name="mainVideo"> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video>

我想将它放在浏览器屏幕的右上角,无论窗口滚动的位置如何(意味着视频保持在顶部)。

I have the following video tag:

<video width="640" height="480" controls id="mainVideo" name="mainVideo"> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video>

and I would like to position it on the top right of the browser's screen, irregardless of where the window scroll is (meaning, the video stays on top).

最满意答案

尝试这个...

#mainVideo{ position:fixed; right:0; top:0; }

Try this...

#mainVideo{ position:fixed; right:0; top:0; }

更多推荐

本文发布于:2023-07-16 04:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1123637.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   位置   标签   视频   fixed

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!