【问题标题】:having close button stick to upper right of video关闭按钮贴在视频的右上角
【发布时间】:2013-09-21 02:46:33
【问题描述】:

当您第一次访问我的页面时,我有一个全屏播放的视频。我想在右上角有一个关闭按钮,但我只能将它保留在窗口的右上角,而不是实际的视频

JSFIDDLE

  <div id="vid">
   <a href="#" class="close_vid"/></a>
   <video  width="100%" height="100%" autoplay>
   <source src="aa.ogg" type="video/ogg">
   <source src="aa.mp4" type="video/mp4">
   <source src="aa.webm" type="video/webm">
   <object data="aa.mp4"  width="100%" height="100%">
   <embed  width="100%" height="100%" src="movie.swf">
  </object>
 </video>
</div>  

我的 CSS

#vid {
 background-color: black;
 clear: both;
 float: left;
 height: 100%;
 list-style: none outside none;
 position: relative;
 width: 100%;
 z-index: 900;
}

#vid .close_vid {
 background: url(icons/zoom-on.png) no-repeat;
 top: 6px;
 cursor: pointer;
 height: 290px;
 opacity: 1;
 position: absolute;
 width: 29px;
 z-index: 999;
 right: 5px;
}

【问题讨论】:

标签: html css


【解决方案1】:
#vid .close_vid {
    position: relative;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-08
    • 1970-01-01
    • 2021-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-06
    相关资源
    最近更新 更多