Hello,
Edit 1: I’ve fixed the formatting, and I’ll throw up a few codepens to show my problem (see edit 2 when it’s here!)
Edit 2: I’ve created 3 fiddles to show what I what I am trying to accomplish, and how the swiper doesn’t conform to the size of a div.
https://jsfiddle.net/mrphuzz/mosnw1vb/
https://jsfiddle.net/mrphuzz/mosnw1vb/15/
https://jsfiddle.net/mrphuzz/mosnw1vb/17/
I’m trying to use swiper by itself (not part of F7). I am designing a responsive page, and for my testing purposes, I have this CSS and HTML:
CSS:
.wrapper {
display: grid;
grid-template-columns: 5fr 3fr;
grid-gap: 0.5em;
}
.wrapper > div {
background:#eee;
padding: 1em;
}
.wrapper > div:nth-child(odd) {
background: #ddd;
}
.box3 {
grid-column: 1/3;
}
HTML:
<div class="wrapper">
<div class="box1">
{swiper code here}
</div>
<div class="box2">
{details go here}
</div>
<div class="box3">
3 Lorem ipsum delor sit.
</div>
</div>
When I add any swiper into any of the “boxes”, instead of it filling the div, it is huge It looks like, at least with the swipers I’ve used, all the slides become visible. I also find this behavior when I use flexbox instead of css grid. Now… if I change “5fr 3fr;” to something like “60% 40%” or “60vw 40vw”, the swiper width fills the width of the div, but then the height of div1 doesn’t increase to fit the height of the swiper. AND… I don’t really want to use percentages anyway, as the “fr” unit was designed for grids and don’t play nicely with paddings and margins.
So, the ultimate question for me is this: how can I use CSS grid (or flexbox) with the fractional units, and have the swiper fill the width of the div, and increase the height of the div to fit the height of the swiper?
Note: I’ve created 3 fiddles (linked above).
Thanks,
Michael