我想在视频上添加一个大的播放按钮。如何根据父div中心元素?
视频本身是响应式的,我希望播放按钮始终在视频中水平和垂直居中。
它将会像
---------------------------
| |
| |
| play button in center | <----video
| |
| |
---------------------------
我有类似:
<div style='text-align:center;'>
<div id='playIcon'><img src='play.png'/></div>
<video id='video' >
<source src=/video.mp4' type="video/mp4">
</video>
</div>
</div>
我的CSS
#video{
width:100%;
max-height:1200px;
z-index: 1;
background-color: black;
}
如何中心的播放按钮,这种情况下?
的可能重复的[中心DIV水平和垂直方向(http://stackoverflow.com/questions/14123999/center-a-div-horizontally-and-vertically) – apaul