css Youtube嵌入式视频在移动的上看起来很奇怪

z2acfund  于 2023-01-27  发布在  其他
关注(0)|答案(1)|浏览(160)

我网站上的YouTube视频在移动的上看起来很奇怪,我试过改变每个视频的宽度和高度,但仍然存在同样的问题。

HTML代码

<div class="playing-cards">

    <iframe width="611" height="450" src="https://www.youtube.com/embed/7qjkrDsgvO8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
  
  <div class="closr">
  
  <iframe width="611" height="450" src="https://www.youtube.com/embed/_PupZlKYYCU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    
  </div>

**CSS CODE**

}

.playing-cards{
    text-align: center;
    height: 560px;
    width: 315px;
    position: absolute;
    top: 107%; right: 0%;
    bottom: 50%; left: 30%;
    
}

.closr{
   text-align: center;
    height: 560px;
    width: 315px;
    position: absolute;
    top: 185%; right: 0%;
    bottom: 40%; left: 30%;
    
}
33qvvth1

33qvvth11#

您应该将其更改为:

<iframe width="315" height="560" src="https://www.youtube.com/embed/7qjkrDsgvO8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

因此它的大小调整为315x560。

相关问题