我想創建一個響應式背景視頻,但不知道如何更改對齊方式。 據我所知,對齊目前是右下角,但我想將它改爲中心。 (如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