2016-11-07 81 views
0

图像和嵌入式视频之间存在差距。移动视图中没有问题。水平图像和嵌入视频之间的差距

<div class="section"> 
 
    <div class="container-fluid"> 
 
    <div class="row"> 
 
     <div class="col-sm-6"><div class="embed-responsive embed-responsive-16by9"> 
 

 
     <img class="embed-responsive-item" width="600px" height="360" src="images\phone.jpg"/>         </div> 
 
     </div> 
 
     <div class="col-sm-6"> 
 
     <div class="embed-responsive embed-responsive-16by9"><iframe width="560" height="315" class="embed-responsive-item" src="https://www.youtube.com/embed/_k4SA"></iframe> 
 
     </div> 
 
     </div> 
 
    </div> 
 
    </div> 
 
</div>

+0

请提供[**最小,完整的,并且可验证示例**](http://stackoverflow.com/help/mcve)。 – Ricky

+0

[如何删除内联块元素之间的空间?]的可能的副本(http://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements) – Aswin

回答

1

添加类 'nopadding' 与COL-SM-6 ...这将解决您的问题。下面的代码

<div class="section"> 
    <div class="container-fluid"> 
    <div class="row"> 
     <div class="col-sm-6 nopadding"><div class="embed-responsive embed-responsive-16by9"> 

     <img class="embed-responsive-item" width="600px" height="360" src="images\lenovok5.jpg"/>         </div> 
     </div> 
     <div class="col-sm-6 nopadding"> 
     <div class="embed-responsive embed-responsive-16by9"><iframe width="560" height="315" class="embed-responsive-item" src="https://www.youtube.com/embed/_9G7CGbk4SA"></iframe> 
     </div> 
     </div> 
    </div> 
    </div> 
</div> 

CSS文件添加:

.nopadding { 
    padding: 0 !important; 
    margin: 0 !important; 
}