A Dip Into CSS Flexbox

Ayu is a tech blogger, open source contributor & maintainer, and tech community enthusiast based in the Netherlands. She loves photography and iced coffee!
Search for a command to run...

Ayu is a tech blogger, open source contributor & maintainer, and tech community enthusiast based in the Netherlands. She loves photography and iced coffee!
No comments yet. Be the first to comment.
This series is my log of what I learned about responsiveness in CSS
Hello Fellow Codenewbies π We've learned in the previous post that applying display: flex to a flex container by default will turn flex items into columns. And when the total width of flex items is bigger than the container, they will stretch to f...
Hi friends π, I've been writing tech blog posts for a few years now. If you don't know me yet, English is my second language. My mother tongue is Indonesian, and I'm also surrounded by Dutch every da

I frequently receive messages from enthusiastic contributors who have completed 2 or 3 high-quality pull requests (PRs) in just 1 month. Theyβre proactive, their work is top-tier, and theyβve handled

A few months ago, I shared a story about building an automated open source portfolio using just my smartphone and an AI assistant while on vacation. My main goal was to stop the "spreadsheet struggle"

Recently, I read Bekah Hawrot Weigelβs blog post, "When 'Local' Went Global: The Pandemic Era of International Communities." As someone active in many online communities, I found it a bit sad, but I agree with her points and think they apply to open ...

Hacktoberfest is almost over. How has your contribution journey been so far? Are you confident about contributing to open source projects, or are you still struggling to find your way? If you're new to open source and still feel overwhelmed, that's c...

Hello Fellow Codenewbies π
Recently I learned more about flexbox in CSS.
I will write this topic in several posts as I learn and dive into it π
Flexbox is a layout model or displaying items in a single dimension β as a row or as a column.
-- MDN Web Docs
Elements normally have default display: block or display: inline from browsers.
Block stacks on top of each other.
Including in this element:
div, header, footer, main, section, etc.h1 - h6)pWhile inline stays within the flow.
astrongemspanWe can change the behavior of these elements. One of the methods is by setting display: flex on the parent element.
.flex-container {
display: flex
}


β UPDATE
The parent element is known as flex container, and the elements inside flex container are flex item.
display: flex will automatically turn the elements inside the parent element into columns.
I provide an example below to play with.
Toggle the display: flex in the example and see how the elements inside flex-container behave and try also to play around with the width of the elements.
display: block or display: inline.display: flex to a parent element, by default, it will turn the elements inside it into columns.