我想创建一个响应式背景视频,但不知道如何更改对齐方式。 据我所知,对齐目前是右下角,但我想将它改为中心。 (如background-position:center center)响应式视频背景:视频对齐
有什么办法可以实现这个吗?
小提琴:http://jsfiddle.net/66dLhjxh/
HTML:
<video autoplay loop poster="http://demosthenes.info/assets/images/polina.jpg" id="bgvid">
<source src="http://demosthenes.info/assets/videos/polina.webm" type="video/webm">
<source src="http://demosthenes.info/assets/videos/polina.mp4" type="video/mp4">
</video>
CSS:
video {
position: fixed;
display:block;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
background-color:#fff;
background:url(../img/schrijven.jpg) no-repeat;
background-size: cover;
background-position: center center;
}
有它左上角只是改变的右侧和底部属性,顶部和左侧 – 2014-10-07 13:44:45
OK,这是具足简单!有什么方法可以集中它吗? – Lisa 2014-10-07 13:47:34