[css] youtube影片設計iframe RWD (iframe RWD with youtube iframe video)

1、css:

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

html結構:

<div class="video-container">
<iframe src="http://player.vimeo.com/video/6284199?title=0&byline=0&portrait=0" width="800" height="450" frameborder="0"></iframe>
</div>

參考資料:Responsive Youtube Embed

您可在此處留言

搶先留言!

avatar
  Subscribe  
Notify of