Back Button JavaScript

Learn Flexbox Through Examples

Flexbox is easily one of the most important additions to CSS in the last decade. The only problem is that there's a bit of a learning curve. Trust me, though: you want to learn this. And once you have, you'll be singing its praises to anyone who will listen. I guarantee it.

8 episodes
1:12:25 hrs
Start Series
    1. Run Time 4:15 Free

      Front-end designers have been joking about this for years. How again are you supposed to horizontally and vertically center a bit of content on the page? Before flexbox, it was kind of tough! No joke. Luckily, this is no longer the case. It's the easiest thing in the world now.

      View the source for this episode on GitHub.

    2. Run Time 6:49

      For step two of your flexbox crash-course, we'll create a typical navigation menu, and then use flexbox to evenly distribute each item with perfect precision.

      View the source for this episode on GitHub.

    3. Consider the most typical of website layouts: a head at the top, a main section - possible consisting of a sidebar and primary content - in the middle, and then a footer stuck to the bottom. Traditionally, we've used floats to accomplish this layout. But the truth is that floats were never truly meant for this sort of thing. Luckily, again, there's a better way. In this episode, we'll discuss the justify-content property more, while reviewing the margin-top: auto trick.

      View the source for this episode on GitHub.

    4. Run Time 8:18

      Let's use flexbox to design the layout for a very simple component that displays a list of episodes in a series. The key lesson for this video is to understand that flexbox is not exclusively for grids and layout. It's useful for even small adjustments.

      View the source for this episode on GitHub.

    5. A media object is an incredibly simple component that you'll find uses for in countless spots in a typical website. The most obvious example is a Facebook status: a user's thumbnail on the left, and possibly a name and message on the right. In this video, we'll build two examples of this very thing, while leveraging flexbox.

    6. Traditional CSS grids are painful to write. In fact, they're so painful to the point that most developers simply reach for a dedicated CSS framework that has all the kinks and bugs worked out. However, with flexbox, it's laughably simple. Seriously - you'll laugh when you see how easy it is to dynamically create any arrangement of columns.

      View the source for this episode on GitHub.

    7. Let's build a navigation menu that requires main links on the left, social network links in the middle, and login/logout links on the far right side. Again, in the last, we would need to defer to awkward floats to accomplish this. But not anymore.

    8. Run Time 12:31

      Imagine lining up a form input, icon, and button; it's really annoying, right? Every single time, it ends up being a confusing mess. "Wait, why is this padding not matching up with the inputs?" But, with flexbox, all of that is out the window. I feel like a record on repeat at this point, but it genuinely couldn't be simpler.

      View the source for this episode on GitHub.

You May Also Enjoy...

Here are some additional series that may be up your alley.