Pap*_*ter 6 html javascript css html5-video twitter-bootstrap
我正在尝试制作带视频的旋转木马.使用图像工作正常,即使在移动视图中,图像也能响应.但是对于视频,宽度是响应但不是高度.基本上我想用旋转木马图像但用视频来实现相同的竞争.我在网上尝试了很多技巧,但没有人这样做.我的视频是1024/552px
尽力而为.你可以看到你是否加载了一个小宽度的小提琴,它保持相同的高度,它没有响应,但旋转木马/视频的宽度是(它虽然在两侧裁剪视频).它与图像没有相同的比例.正如您将看到的,我在第二张幻灯片中包含了一张图片,以进一步展示我的问题.
https://jsfiddle.net/687bsb21/1/
这是代码:
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<div align="center">
<video autoplay loop>
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" width="1024" height="552" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
<div class="carousel-caption">
<h3>hello</h3>
<p>hello</p>
</div>
</div>
<div class="item">
<img src="http://dummyimage.com/1024x552/000/fff" class="img-responsive" alt="asfds">
<div class="carousel-caption">
<h3>hello</h3>
<p>hello.</p>
</div>
</div>
<a class="left carousel-control" href="#carouselHelp" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carouselHelp" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助.
添加你的CSS,
video{
width:100%
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
50519 次 |
最近记录: |