2016-03-26 60 views
0

背景我有我的代碼有問題我已經提到了這一點 - 溢出:隱藏在CSS但是我的視頻沒有提到我的CSS以下的text.I如下圖所示:視頻在HTML

fullscreen-bg { 
       top: 0; 
       right: 0; 
       bottom: 0; 
       left: 0; 
       overflow:hidden; 
       `enter code here`z-index: -100; 
} 

.fullscreen-bg__video { 
         position: absolute; 
         top: 0; 
         left: 0; 
         width: 100%; 
         height: 100%; 
} 
+2

分享html也..或可能然後分享活鏈接/演示或jsfiddle.thanx –

+1

是的,請分享您試圖在代碼操場使用的HTML版本和可能的視頻背景,如jsfilddle .. – Ashwin

+0

HTML -

Shreya

回答

0

這不是我寫的,但它應該給你一個粗略的想法如何做到這一點,

video { 
    position: fixed; 
    top: 50%; 
    left: 50%; 
    min-width: 100%; 
    min-height: 100%; 
    width: auto; 
    height: auto; 
    z-index: -100; 
    transform: translateX(-50%) translateY(-50%); 
background: url('//demosthenes.info/assets/images/polina.jpg') no-repeat; 
    background-size: cover; 
    transition: 1s opacity; 
} 
.stopfade { 
    opacity: .5; 
} 

來源:

https://codepen.io/dudleystorey/pen/knqyK

+0

是否需要使用java腳本來做到這一點? – Shreya