2016-02-13 68 views
0

我想在首頁上看到一個全寬但不是全高的視頻,但它不起作用。如果我設置高度,它總是縮小。html 5視頻全寬,特殊高度

#video_startpage { 
    position: fixed; 
    top: 0; 
    left: 0; 
    bottom: 0; 
    right: 0; 
    z-index: -1000; 
    min-width:100%; 
    max-height:400px; 
} 

小提琴:https://jsfiddle.net/Lxz43sga/#&togetherjs=yrnrdNEaIu

+0

只需設置'height'爲'400px',而不是'MAX-height' – SidOfc

+0

不會改變任何東西:( –

+0

我只注意到檢查小提琴的時候,我覺得'video'元素進行相應調整大小一個16:9的長寬比 – SidOfc

回答

0

結束了使用此!像魅力一樣工作。

<div id="videoarea"> 

<video width="100%" height="auto" autoplay loop id="video_startpage" > 
    <source src="demo3.mp4" type="video/mp4"> 

</video> 



#videoarea { 
height:70%; 
width:100%; 
overflow:hidden; 
} 

#video_startpage { 
z-index:-9999}