How to Overlap Flex Items with CSS Flexbox - Beginner Tutorial

Publié le: 08 novembre 2021
sur la chaîne: Front End Beginners
15,198
201

In this video, we'll look at how to overlap flex items in CSS Flexbox.

The first method is using "position: relative" in combination with top, bottom, left, or right values.

The second method is using the CSS "transform: translate()" property, which allows us to reposition items along both the X- and Y-axis.

Re-positioned items are given a new "stacking context", which means they'll be stacked on top of other HTML elements regardless of their original source order.

To overcome this, we need to give the affected elements a position of "relative", which brings them into the new stacking context and restores the default order.

I hope you found this video helpful. If you have any questions, please leave them in the comments below and I'll do my best to answer as soon as possible.

TIMESTAMPS:
00:00 Introduction
00:29 Method one - "position: relative"
02:00 Method two - "transform: translate()"
03:11 Overlapping and the "stacking context"
06:10 Summary

WATCH NEXT:
• How to Use CSS Position Relative -    • How to Use CSS Position Relative - A ...  
• How to Make One Flex Item Full-Width -    • How to Make One Flex Item Full-Width ...  
• Create a Responsive Grid Layout with CSS Flexbox -    • How to Create a Grid Layout with CSS ...  


Sur cette page du site, vous pouvez voir la vidéo en ligne How to Overlap Flex Items with CSS Flexbox - Beginner Tutorial durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Front End Beginners 08 novembre 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 15,198 fois et il a aimé 201 téléspectateurs. Bon visionnage!