【发布时间】:2017-11-03 16:08:48
【问题描述】:
我将相同尺寸的图片 (300x400) 和视频 (300x400) 分别放入父 div 中。
<div class="bgimage col-md-12 col-sm-12 col-xs-12 ">
<div class="ol-md-6 col-sm-6 col-xs-12">
<img src="img" >
</div>
</div>
和
<div class="bgimage col-md-12 col-sm-12 col-xs-12 ">
<div class="ol-md-6 col-sm-6 col-xs-12">
<video loop autoplay class="autov">
<source src="./resources/img/Video.mp4" type="video/mp4">
</video>
</div>
</div>
这是css中的定义。
.bgimage {
background-image: url(../img/bg2.png);
/* Full height */
height: 100%;
width:100%;
padding: 30px 50px 30px 50px;
/* Background image is centered vertically and horizontally at all times */
background-position: center center;
/* Background image doesn't tile */
background-repeat: no-repeat;
/* This is what makes the background image rescale based
on the container's size */
background-size: 100% 100%;
/* Set a background color that will be displayed
while the background image is loading */
background-color: #red;
}
但是视频的容器高度略大。
【问题讨论】:
-
您在 col-md-6 中还缺少一个“c”
-
@Liquidchrome 谢谢。
-
我问这个问题是因为屏幕上的图像和视频的大小相同。而且他们的底线是同一水平的。
标签: html css twitter-bootstrap