CORE CONCEPTS

CORE CONCEPTS

New

The Box Model

The Box Model

New

1:54

Intro to Web Layout

Intro to Web Layout

New

2:27

Display Settings

Display Settings

New

2:54

Padding & Margin

Padding & Margin

New

2:48

Width & Height Units

Width & Height Units

New

3:59

Floats & Clears

Floats & Clears

New

1:52

Flexbox & Grid

Flexbox & Grid

New

Intro to Flexbox

Intro to Flexbox

New

2:27

Centering Elements with Flexbox

Centering Elements with Flexbox

New

1:20

Equal Height Layouts with Flexbox

Equal Height Layouts with Flexbox

New

1:47

Grid layouts overview

Grid layouts overview

New

4:18

Flexbox vs. Grid

Flexbox vs. Grid

New

4:00

Advanced Layout

Advanced Layout

New

Positioning Overview

Positioning Overview

New

1:48

Relative Positioning

Relative Positioning

New

1:43

Absolute Positioning

Absolute Positioning

New

1:43

Fixed Positioning

Fixed Positioning

New

1:27

Z-Index

Z-Index

New

1:49

Overflow

Overflow

New

1:49

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 this video, we'll give you a brief overview of some of the common CSS layout and positioning options available.

Explore this project

Want to dig into the project featured in this video and see how everything is put together? We've included the full project we used when making this lesson, and we've shared the link right under this very paragraph.

View and clone this projectDownload lesson assets
Clone this projectDownload project 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.