I am making a slider for someone. It needs to have two slides visible at any one time. When the user clicks next/previous I would like for just one slide to be popped off the visible slides and the new one brought in.
Using flexbox makes centralisation easy, however, it appears that I cannot force the elements to be the size I wish (50/50). Instead it is taking into consideration all slide elements which are present and divvying space accordingly.
I know I can put them into slides of two but that could lead to one slide being present on the page and would require extra logic to account for that scenario plus, it would just look a bit scruffy.
I wanted to ask before I continue down this rabbit hole: Is my goal possible with flexbox? I know I can just use display:inline-block
, set my position to absolute and then use transform:translateX(XXX)
to move the slides around, I just thought I would see if it was possible with flexbox.
Thanks in advance.