【问题标题】:html5 video element 1px white bottom border on chromehtml5 视频元素 1px chrome 上的白色底部边框
【发布时间】:2017-03-18 20:30:05
【问题描述】:

由于某种原因,在 Chrome 上,我的视频容器元素底部出现了一个白色底部边框。

<video id="cover" src="video.mp4" autoplay="" loop=""></video>

有谁知道如何解决这个问题?

这是video 元素的计算样式。

background-color:rgb(0, 0, 0);
border-bottom-color:rgb(0, 0, 0);
border-bottom-style:none;
border-bottom-width:0px;
border-image-outset:0px;
border-image-repeat:stretch;
border-image-slice:100%;
border-image-source:none;
border-image-width:1;
border-left-color:rgb(0, 0, 0);
border-left-style:none;
border-left-width:0px;
border-right-color:rgb(0, 0, 0);
border-right-style:none;
border-right-width:0px;
border-top-color:rgb(0, 0, 0);
border-top-style:none;
border-top-width:0px;
display:inline-block;
font-family:Times;
font-size:16px;
font-stretch:normal;
font-style:normal;
font-variant-caps:normal;
font-variant-ligatures:normal;
font-variant-numeric:normal;
font-weight:normal;
height:798.547px;
line-height:16px;
margin-bottom:0px;
margin-left:0px;
margin-right:0px;
margin-top:0px;
object-fit:contain;
opacity:1;
padding-bottom:0px;
padding-left:0px;
padding-right:0px;
padding-top:0px;
vertical-align:baseline;
width:1680px;

【问题讨论】:

  • 你试过用border: none;覆盖它吗?
  • @Petar-Krešimir 是的,我已经编辑以显示我的计算风格。在您尝试使用 chrome 将视频放入 html5 元素之前不要投票给我。

标签: html google-chrome html5-video


【解决方案1】:

对我来说,问题原来是大纲。将其设置为none 解决了它:

video {
   outline: none;
}

【讨论】:

    【解决方案2】:

    聚会有点晚了,但这里有一个对我有用的小而简单的技巧:

    video {
      margin-bottom: -1px;
    }
    

    【讨论】:

      【解决方案3】:

      就我而言,它是line-height。我将它设置为0,这个“边框底部”消失了。

      【讨论】:

        【解决方案4】:

        在我的例子中,问题在于盒子尺寸。刚刚添加

        -webkit-box-sizing: unset;
        -moz-box-sizing: unset;
        box-sizing: unset;
        

        到父容器并且边框消失。

        【讨论】:

          【解决方案5】:

          我通过在视频元素上应用边框半径意外地解决了这个问题。

          video { border-radius:1px; }
          

          【讨论】:

            【解决方案6】:

            由于我无法解释的原因,修复方法是添加“显示:块;”给你的。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2011-08-13
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2013-06-03
              相关资源
              最近更新 更多