html - 水平图像和嵌入视频之间的差距

标签 html css twitter-bootstrap grid-layout

图片和内嵌视频有差距,移动端看没有问题。

<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>

最佳答案

用 col-sm-6 添加类 'nopadding' ...这将解决您的问题。

<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;
}

关于html - 水平图像和嵌入视频之间的差距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40458070/

相关文章:

php - Symfony2 中有或没有 Assetic 的 Assets 让我发疯

html - 在按钮 div 之后获取随机链接

javascript - 拖放文件,然后使用 HTML5 POST 到 URL

html - 如何在没有媒体查询的情况下使 ASCII art <pre> 标签响应?

javascript - 我怎样才能包装div?

css - bootstrapscaffolding.less 正在更改默认 style.css

html - Bootstrap 元素在 Firefox 中无法正确堆叠

twitter-bootstrap - 输入组 - 两个彼此靠近的输入

css - 当我最小化浏览器窗口大小时,页面看起来异常

html - 如何为 svg 元素路径提供背景颜色?