【问题标题】:HTML5 video space on Safari?Safari 上的 HTML5 视频空间?
【发布时间】:2018-02-23 07:00:52
【问题描述】:

我有一个 HTML5 视频作为标题的背景。 视频尺寸为 1280 x 720。但在 safari 中,它们是 HTML5 视频顶部和底部的空间。此空间仅在 Mac OS X 上的 safari 上显示,在 Google Chrome、Mozilla Firefox、Microsoft Edge 上显示良好。我尝试为display 添加display: block 和许多其他值,但没有奏效。此外,如果我进入 Inspect Element 并关闭 display 然后重新打开它,它将再次开始工作。

另外提到这个网站是 WordPress 的自定义主题。

我的密码:

HTML:

    <div class="home-banner">

        <div class="fullscreen-bg clearfix">

            <!-- Video -->

            <video class="hidden-xs" loop autoplay muted poster="images/videoframe.jpg">

                <source src="video/trailer.mp4" type="video/mp4">

            </video>

        </div>
    </div>
</header>

CSS:

video {
    /*float: left;*/
    width: 100%;
}
.fullscreen-bg {
    width: 100%;
    margin: 0 auto;
    position: relative;
}
.fullscreen-bg .container {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1111;
    right: 0;
    margin: 0 auto;
    width: 85% !important;
}
.home-banner {
    /*background-image: url(../images/home-banner.jpg);*/
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: cover;
    height: 100%;
}

他们对此有任何更新吗?

【问题讨论】:

    标签: css wordpress html safari


    【解决方案1】:

    我想通了。

    我刚用过:

    video {
        /*float: left;*/
        min-width: 100%;
        min-width: 100%;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-14
      • 2011-10-03
      • 2016-06-06
      相关资源
      最近更新 更多