new course
CSS grid landing page tutorial (36min)

Lesson info

Lesson info

Webflow's Style Panel gives you several layout methods to help you position content in your project. In many cases, multiple layout methods could be used to achieve the same effect, but some are better than others, in terms of reliability or cross-browser performance. 

In this video, we'll define the various layout tools you have to work with, including:

  1. ‍Block
  2. ‍Inline block
  3. ‍Inline
  4. ‍Flex
  5. ‍Float
  6. ‍Positioning
  7. ‍Overflow
  8. ‍Transform
  9. ‍Padding and margin

We also take a deeper dive on the first four in our video on Display Settings.

Clone this projectDownload project assetsDownload lesson assets

Transcript

This video lesson is an overview of some of the major layout controls on the Style Panel. As we know, in CSS, styles can be used to control layout.

And sometimes there are multiple ways to do things — to create what looks and even functions the same way — so it's helpful for us to have a good overview.

We'll touch on display settings like block, inline block, inline, and flex. Then we'll talk padding and margin, float, overflow, positioning, and finally: transforms.

We've created detailed content on each of these, so what you're about to see is a quick, top-level overview of these layout controls.

So. Let's do display settings like block elements. Block elements, like headings and paragraphs by default — they stack on top of each other. They don't wrap, and their boundaries take up the full width of their parent element, unless we set custom dimensions.

With inline block, elements are only as wide as the content inside. Elements sit next to each other on the same line, and when they hit the inner boundary of their parent? They wrap to the next line.

Inline elements behave just like text. Text spans or text links are good examples of this — they ignore set dimensions but they'll take into account typography values (like font size).

Flexbox is a super powerful layout tool. That's actually how it's described in the official spec. Except it isn't. We doctored this image. Flexbox lets us align and size or stretch and organize items inside a container.

Up next. Padding and margin. These controls let us create breathing room inside (for padding) or outside (for margin) of an element's boundary.

Then there are floats. When something's set to float, text will wrap around it.

Then we have overflow, which gives us control over whether content inside an element is allowed to spill outside the element's boundaries.

We have positioning, which affects how elements are positioned relative to themselves. Auto (or Static) respects the normal flow of content, relative lets us move something around without affecting other elements, absolute lets us position something around its parent element, and fixed lets us position something around the viewport. Great for persistent navigation. Or wonderful popup ads.

And finally, transform. This lets us move, or rotate, or scale, or skew content.

Like we said at the beginning, this is a quick crash course on many of our layout options. We've created detailed content for each of these — but this serves as a brief overview to get started or brush up on some of these CSS layout properties.