Fri 10 Jan 2020

The “Inside” Problem

So, you're working on a design. You need a full-width container element because the design has a background-color that goes from edge-to-edge horizontally. But the content inside doesn’t necessarily need to be edge-to-edge. You want to:

  1. Limit the width (for large screens)
  2. Pad the edges
  3. Center the content

It's "the inside problem" in web layout. It's not hard, it's just that there are lots of considerations.

Source: The “Inside” Problem, an article by Chris Coyier.

Mastering Wrapping of Flex Items

Flexbox was designed as a single dimensional layout, meaning that it deals with laying out items as a row or as a column — but not both at once. There is however the ability to wrap flex items onto new lines, creating new rows if flex-direction is row and new columns if flex-direction is column. In this guide I will explain how this works, what it is designed for and what situations really require CSS Grid Layout rather than flexbox.

Source: Mastering Wrapping of Flex Items.