Flexbox???
Arguably the most important concept in CSS is a most know for every web dev.
I like to think of it as "flexible box" or "flex d' box" 😊.
You remember how every element is a box? the flexbox concept gives us flexibility with them. helps us moves element around the page however we want, wherever we want - It's just like.........flirting 😁
Let's go through some of the most used properties of Flexbox:
- display: flex - this initiates the flex mode
- justify-content: start/ Centre/ end - Moves the element to the beginning, Centre and end of the parent horizontally.
- align-items: start/center/end - Moves the element to the beginning, Centre and end of the parent vertically.
- justify-content: space-around - creates equal space around the content
- justify-content: space-between - creates equal space between/middle the content
- gap: 5px - creates a space of 5px between the content
there are other properties of flex that you can play around with. such as:
flex-wrap, flex-grow, flex-shrink, justify-self etc.
Just flirt around flexbox and experience the possibilities this unique feature grants you.
Having this skill is a CSS superpower 💪 as Ndubueze nwoko will say - "you can't escape from it" 🧠