This is my first post here ????
For some context, I’m currently developping a portfolio website type with Kirby cms, loading content dynamically.
My issue is, my slides are split depending on the number of children of the folder, however I would like my embed video (from vimeo) to always cover my entire div wether its 100% of the screen width or 50%, 25% ect of the screen same thing with window resize or so, any how, just like an img object-fit: cover would. I know its possible with not embed video / background video but in that case I cant seem to make it work.
Is that possible ?
my html looks like :
<?php if ($section->vimeo()->isNotEmpty()): ?>
<div class="slide-projets">
<iframe src="https://player.vimeo.com/video/<?= $section->vimeo()?>?background=1&" style="width:100%;height:100%;" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen=""></iframe>
</div>
<?php endif; ?>
and my css :
.slide-projets {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
}
.slide-projets iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
Thanks a lot, its quite ok in most cases but still fallible so if I can better it, I’m interested !
have a good day
J
Josie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.