html - 在视频上叠加 HTML 单选按钮

标签 html css html5-video overlay

我想在视频顶部覆盖 HTML 单选按钮,以便您可以选择它们。如果有帮助,我知道每个彩色框的像素坐标。就像下面的例子一样,黑色圆圈代表我可以点击的单选按钮。如何使用 CSS 对其进行格式化? enter image description here

<style>
  #container {
      width: 428px;
      height: 200px;
      position: relative;
  }

  #overlay {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 50px;
      left: 50px;
      color: red;
      font-size: 40px;
      z-index: 10;
  }

  #base {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0px;
      left: 0px;
  }
</style>
  </head>
  <body>
    <div id="container">
      <div id="overlay">
        <form action="">
          <input type="radio" name="white" value="1" />
          <input type="radio" name="white" value="2" />
          <input type="radio" name="white" value="3" />
          <input type="radio" name="white" value="4" />
          <input type="button" id="continue" value="Continue"/>
        </form>
      </div>
      <div id="base">
        <video controls>
          <source src="videos/event_0_Junli_Standing_20150322_181647_00_0.6.mp4" type="video/mp4">
          Your browser does not support the video tag.
        </video>
      </div>
    </div>
  </body>

最佳答案

我最好的选择是让单选按钮位于 position: absolute 并使用 top:right: 将它们移动到视频上方>.

JSfiddle demo

关于html - 在视频上叠加 HTML 单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44974627/

相关文章:

javascript - JavaScript 注入(inject)的内部 CSS 不适用

html - Imagemap:点击显示文字

html - 为什么不显示 Bootstrap 导航栏移动菜单?

html - 集成Leaflet和Bootstrap : help refactoring my css

javascript - 无法使用 JQuery 功能切换图像

android - Android 2.1 的浏览器是否支持 HTML 5 以及它播放什么视频格式?

javascript - 播放带字幕的视频

html - 如何将一些文本垂直放置在圆 div 的中心?

javascript - 如何更改 html5 视频元素的默认轨道?

html - 应用渐变的图像 : better performance adding gradients via css or apply them directly to the src img?