为什么我的视频盘旋在我的视频播放器上重叠?

发布于 2025-01-21 21:58:47 字数 1776 浏览 0 评论 0原文

基本上,当悬停时,我的图像是 *2缩放的,它按照我的期望与我的视频重叠,问题在于,它仅与我的视频重叠,而不是带有计时器和视频的播放按钮的播放器。我试图添加z索引:2英寸Voyage-image:悬停,但似乎没有效果。因此,我想要的是,当悬停时,图像与视频和播放器重叠...谢谢您的帮助:)

另外,我是MacOS用户,并使用勇敢!

.fiche-voyage {
  width: 100vw;
}
.voyage-image-row {
    width: 50%;
    display: flex;
    margin: 0 auto;
    justify-content: space-around;
  }
.voyage-media-container {
    width: 50%;
    padding: 15px;
    text-align: center;
    display: flex;
    align-items: center;
  }
.voyage-image,
  .voyage-video {
    width: 100%;
  }
  .voyage-image:hover {
    transform: scale(2);
    transition: cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
    z-index: 2;
  }
    <div class="fiche-voyage">
        <div class=" voyage-image-row">
            <div class="voyage-media-container">
                <div class="voyage-media-align">
                    <img src="https://i.discogs.com/1pfWOq9PLZlhgHWipY4dcKuFEh-0JQiSrG8Fvo79j60/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTEyMTM3/MTI2LTE1MjkwNDM2/MTMtMzQ4NS5wbmc.jpeg" class="voyage-image">
                    <p>caption</p>
                </div>
            </div>
            <div class="voyage-media-container">
                <div class="voyage-media-align">
                    <video controls="controls" class="voyage-video">
                        <source src="video1.mp4">
                    </video>
                    <p>caption</p>
                </div>
            </div>
        </div>
    </div>
    

Basically when hovered, my image is *2 scaled and it overlaps my video as I expect it to, the problem is that it only overlaps my video, not the player with the timer and the play button of my video. I've tried to add a z-index: 2 in .voyage-image:hover but it seems like it has no effect. So, what i'd like is when hovered, the image overlaps the video AND the player... Thanks for your help :)

Also, I'm a MacOS user and using Brave!

.fiche-voyage {
  width: 100vw;
}
.voyage-image-row {
    width: 50%;
    display: flex;
    margin: 0 auto;
    justify-content: space-around;
  }
.voyage-media-container {
    width: 50%;
    padding: 15px;
    text-align: center;
    display: flex;
    align-items: center;
  }
.voyage-image,
  .voyage-video {
    width: 100%;
  }
  .voyage-image:hover {
    transform: scale(2);
    transition: cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
    z-index: 2;
  }
    <div class="fiche-voyage">
        <div class=" voyage-image-row">
            <div class="voyage-media-container">
                <div class="voyage-media-align">
                    <img src="https://i.discogs.com/1pfWOq9PLZlhgHWipY4dcKuFEh-0JQiSrG8Fvo79j60/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTEyMTM3/MTI2LTE1MjkwNDM2/MTMtMzQ4NS5wbmc.jpeg" class="voyage-image">
                    <p>caption</p>
                </div>
            </div>
            <div class="voyage-media-container">
                <div class="voyage-media-align">
                    <video controls="controls" class="voyage-video">
                        <source src="video1.mp4">
                    </video>
                    <p>caption</p>
                </div>
            </div>
        </div>
    </div>
    

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盗琴音 2025-01-28 21:58:47

尝试这个!

.fiche-voyage {
    width: 100vw;
}
.voyage-image-row {
    width: 50%;
    display: flex;
    margin: 0 auto;
    justify-content: space-around;
}
.voyage-media-container {
    width: 50%;
    padding: 15px;
    text-align: center;
    display: flex;
    align-items: center;
}
.voyage-image,
.voyage-video {
    width: 100%;
}
.voyage-image:hover {
    transform: scale(2);
    transition: cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
    z-index: 2;
}
.top{
    z-index: 1;
}
<div class="fiche-voyage">
    <div class=" voyage-image-row">
        <div class="voyage-media-container top">
            <div class="voyage-media-align">
                <img src="https://i.discogs.com/1pfWOq9PLZlhgHWipY4dcKuFEh-0JQiSrG8Fvo79j60/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTEyMTM3/MTI2LTE1MjkwNDM2/MTMtMzQ4NS5wbmc.jpeg" class="voyage-image">
                <p>caption</p>
            </div>
        </div>
        <div class="voyage-media-container">
            <div class="voyage-media-align">
                <video controls="controls" class="voyage-video">
                    <source src="video1.mp4">
                </video>
                <p>caption</p>
            </div>
        </div>
    </div>
</div>

在这里,我在第三个Div中添加了另一个类,并将其Z Index设置为1。

谢谢和最诚挚的问候!

Try this one!

.fiche-voyage {
    width: 100vw;
}
.voyage-image-row {
    width: 50%;
    display: flex;
    margin: 0 auto;
    justify-content: space-around;
}
.voyage-media-container {
    width: 50%;
    padding: 15px;
    text-align: center;
    display: flex;
    align-items: center;
}
.voyage-image,
.voyage-video {
    width: 100%;
}
.voyage-image:hover {
    transform: scale(2);
    transition: cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
    z-index: 2;
}
.top{
    z-index: 1;
}
<div class="fiche-voyage">
    <div class=" voyage-image-row">
        <div class="voyage-media-container top">
            <div class="voyage-media-align">
                <img src="https://i.discogs.com/1pfWOq9PLZlhgHWipY4dcKuFEh-0JQiSrG8Fvo79j60/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTEyMTM3/MTI2LTE1MjkwNDM2/MTMtMzQ4NS5wbmc.jpeg" class="voyage-image">
                <p>caption</p>
            </div>
        </div>
        <div class="voyage-media-container">
            <div class="voyage-media-align">
                <video controls="controls" class="voyage-video">
                    <source src="video1.mp4">
                </video>
                <p>caption</p>
            </div>
        </div>
    </div>
</div>

In here I have add another class to the third div and set its z-index to 1.

Thanks and best regards!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文