2017-05-19 8 views
0

私はこれやろうとしている: IMGビデオで画面を埋めるには?

を、ここのコードです:

<div class="container" id="containervideo"> 
    <div id="video"> 
     <div class="box iframe-box"> 
     <div class="container"> 
      <iframe src="http://player.vimeo.com/video/67794477?title=0&amp;byline=0&amp;portrait=0&amp;color=0fb0d4" width="1280" height="720" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 
      </div> 
     </div> 
     </div> 

    </div> 

CSS:

#containervideo { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    padding: 0; 
    margin: 0; 
    left: 2px; 
    top: 936px; 
    z-index: -1000; 
    overflow: hidden; 
    } 
    #video { 

min-height: 100%; 
    //min-width:100%; - if fit to width 
position:absolute; 
bottom:0px; 
left:0; 
    } 

常に画面の中央に取得した映像は、それが両側を埋めることはありません。誰でも助けてくれますか? :(

+0

代わりに 'container'使用'コンテナfluid' – Deathstorm

+1

のあなたのiframeの幅と高さを持つとCSSでそれcontrollしようとなぜですか?それは働いた – High

答えて

2

を追加あなたがそうのような絶対にIFRAMEの位置を設定するCSSルールを追加することができます。

.iframe-box iframe { 
 
    width: 100%; 
 
    height: 100%; 
 
    position: absolute; 
 
    top: 0; 
 
    bottom: 0; 
 
    left: 0; 
 
    right: 0; 
 
}
<div class="box iframe-box"> 
 
    <iframe src="http://player.vimeo.com/video/67794477?title=0&amp;byline=0&amp;portrait=0&amp;color=0fb0d4" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 
 
</div>

+0

!:)あなたはどのように私を知っていますその黒い国境をビデオから取る?私はそれを私が掲示したイメージにもっと類似させなければならない。 – Kali

0

それが画面を埋めるために取得するだけで、幅と高さはiframeにセット属性を削除

position: absolute; 
top: 0; 
bottom: 0; 
left: 0; 
right: 0; 
関連する問題