Removing black borders on a vimeo iframe embed using CSS?

前端 未结 8 2097
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-12 11:29

I am trying to find a way to hide the black strips across the top and bottom of a vimeo video. I thought there might be a way to cover them up with CSS.

I basically

8条回答
  •  渐次进展
    2021-01-12 12:01

    HTML:

    [video html goes here]

    CSS:

    .js-video {
      height: 0;
      padding-top: 25px;
      padding-bottom: 67.5%;
      margin-bottom: 10px;
      position: relative;
      overflow: hidden;
    }
    
    .js-video.widescreen {
      padding-bottom: 57.25%;
    }
    
    .js-video.vimeo {
      padding-top: 0;
    }
    
    .js-video embed, .js-video iframe, .js-video object, .js-video video {
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      position: absolute;
    }
    

    You will find more details here

提交回复
热议问题