How to Overlap Flex Items with CSS Flexbox - Beginner Tutorial

Опубликовано: 08 Ноябрь 2021
на канале: 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 ...  


На этой странице сайта вы можете посмотреть видео онлайн How to Overlap Flex Items with CSS Flexbox - Beginner Tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Front End Beginners 08 Ноябрь 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 15,198 раз и оно понравилось 201 зрителям. Приятного просмотра!