视频播放代码
xuexi 2025-06-22 19:35:41 发表在:PHP 查看数:36
    <style>
    .video-container {
    position: relative; /* 确保子元素绝对定位时相对于它定位 */
    width: 100%; /* 容器宽度为100% */
    padding-top: 56.25%; /* 视频的宽高比通常是16:9,56.25%的高度可以保持宽高比 */
}

.video-container video {
    position: absolute; /* 视频相对于容器定位 */
    top: 0;
    left: 0;
    width: 100%; /* 视频宽度为100% */
    height: 100%; /* 视频高度为100% */
}
 </style>
<div class="video-container">
         <video controls poster="/style6_files/y.jpg">
        <source src="/style6_files/y.mp4" type="video/mp4">
        Your browser does not support the video tag.
         </video>
        </div>
最近访问时间:2025-06-30 08:31:57
知识库:354条鸣谢:TAY  备案号:蜀ICP备2024090044号-2