Cách Fix Responsive cho Video nhúng từ YouTube, Vimeo

Nhúng code này vào CSS

/*VIDEO CONTAINER */
 
.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%;
}

Sau đó cho đoạn Embed code từ Youtube hay Vimeo vào trong thẻ

<div class="video-container">Code Embed</div>

Comments

So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Sidebar