Bootstrap嵌入响应式视频(可无障碍浏览)的方法

Bootstrap嵌入响应式视频(可无障碍浏览)的方法

 2016-01-11 10:51

昨晚,我测试了下Bootstrap框架下video视频的插入,发现通过 diviframe可以轻松实现视频的插入,效果详见《“他怎么那么红” 相声瓦舍和德云社一样能讲传统相声》。

通过对Bootstrap的学习,我发现,只要通过它原有代码就可以做到了,原Bootstrap插入的video视频的方法如下:

<!-- 16:9 aspect ratio  --> 
<div class="embed-responsive embed-responsive-16by9">
    <iframe class="embed-responsive-item" src="..."></iframe>
</div>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
    <iframe class="embed-responsive-item" src="..."></iframe>
</div>

原方法中,通过.embed-responsive来组成基本框架的构建,然后再通过<iframe><embed><video><object>插入视频,加上.embed-responsive-item标签就可以了,整个方法还是比较简单的。另外.embed-responsive-16by9.embed-responsive-4by3是两个来区分视频比例的参数。

那篇文章中插入代码如下:

<div style="text-align: center;" class="embed-responsive embed-responsive-4by3">
    <iframe src="http://player.youku.com/embed/XMTMyOTQ4MjEzMg==" allowfullscreen="" class="embed-responsive-item" frameborder="0" height="498" width="510"></iframe>
</div>
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值