HTML5 Video element on IPhone has border

前端 未结 3 862
温柔的废话
温柔的废话 2021-02-15 13:51

I have been building an app recently and have a loading animation playing at the start (just a mp4 video - for aesthetic purposes). It works great everywhere apart from on Iphon

3条回答
  •  忘掉有多难
    2021-02-15 14:20

    I had to go with the approach of a wrapper div and a position absolute one, something like:

    HTML

    CSS

    .wrapper {
        display: block;
        position: relative;
        font-size: 0;
    }
    
    .video-ios-border-fix {
        position: absolute;
        z-index: 1;
        box-sizing: initial;
        left: -2px;
        top: -2px;
        right: -2px;
        bottom: -2px;
        border: 4px solid #fff;
    }
    
    video {
        width: 100%;
    }
    

提交回复
热议问题