Possible to use flex instead of absolute positioning on the swiper?
See original GitHub issueThanks for the great work! Just wondering if it’s possible to use flex layout on the Swiper
instead of absolute so it’s easier to config it’s layout?
I have’t dive deep into the src code to learn if position: absolute
is critical. If it’s not I’m willing to help 😃
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Does 'position: absolute' conflict with Flexbox? - Stack Overflow
No, absolutely positioning does not conflict with flex containers. Making an element be a flex container only affects its inner layout model ...
Read more >Flexbox and absolute positioning - CSS-Tricks
Chen Hui Jing notes that when you absolutely position a flex item, it's no longer part of the flex layout. Except… it kinda...
Read more >CSS Positioning Classes - Quasar Framework
The list of CSS classes supplied by Quasar to simplify the positioning of a DOM element.
Read more >How to Build a Responsive Slider With Swiper.js - Web Design
In this tutorial, we'll build a unique page layout by taking advantage of Swiper.js, one of the most popular JavaScript sliders available ...
Read more >Team:FAFU-CHINA/CSS/SWIPER-CSS - iGEM 2021
Swiper 4.5.3 * Most modern mobile touch slider and framework with hardware accelerated ... .swiper-slide-shadow-top{position:absolute;left:0;top:0 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What would be better would be to change the sizing of the cards relatively to parent or hardcoded via props. Right now sizing is done based on device size.
Why switch to flex when you can wrap your swiper in a <View> with position: ‘relative’ and then the swiper will be configured based on the parent? With position absolute and zIndex it is really easy to style and animate the cards on top of each other, create a stack effect and so on. With flex you won’t be able to stack them on top of each other and it will complicate everything.
@mschiele not sure if you fixed your problem yet, but if you use flex for the map and a view on the bottom area of the screen, have the view with position: ‘relative’, then the swiper will be positioned absolutely within the view (not the entire screen), therefor, it will not flow on top of your map.
Good read on zIndex https://www.smashingmagazine.com/2009/09/the-z-index-css-property-a-comprehensive-look/ Absolute & relative positioning https://css-tricks.com/absolute-positioning-inside-relative-positioning/
Once you understand the concepts behind the 3, you’ll be able to easily play around without any issues.