Safari on iPad (iOS6) does not scale HTML5 video to fill 100% of page width

后端 未结 5 1662
你的背包
你的背包 2020-12-07 13:08

I am using the following CSS to display a video in full width (100%) on a responsive HTML5 page. The native size of the video is 480x270. The video is scaled to fill the ful

5条回答
  •  再見小時候
    2020-12-07 13:37

    you can use this to set center your video in container with margins as you want. no need to add extra element. fix for iOS 7 specially. pay attention to -webkit-calc prefixes if need

    width: 100%;
    position: absolute;
    top: calc(50% - 10px);
    left: 50%;
    height: calc(100%);
    -webkit-transform: translateY(-50%) translateX(-50%);
    

提交回复
热议问题