Responsive iframe using Bootstrap

前端 未结 6 584
名媛妹妹
名媛妹妹 2020-12-04 05:44

I am using Bootstrap.

I have a text which contains 2 or 3 iframes based embed videos.

This data is fetched from database.

How can I make these iframe

6条回答
  •  生来不讨喜
    2020-12-04 06:16

    The best solution that worked great for me.

    You have to: Copy this code to your main CSS file,

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

    and then put your embeded video to

    That’s it! Now you can use responsive videos on your site.

提交回复
热议问题