Web Structure

Web Structure

New

Intro to HTML & CSS

Intro to HTML & CSS

New

3:38

HTML Structure

HTML Structure

New

1:55

The Box Model

The Box Model

New

1:54

Responsive Design

Responsive Design

New

Intro to Responsive Design

Intro to Responsive Design

New

2:21

CSS Layout

CSS Layout

New

Intro to Web Layout

Intro to Web Layout

New

2:27

Intro to Flexbox

Intro to Flexbox

New

2:27

Grid layouts overview

Grid layouts overview

New

4:18

Width & Height Units

Width & Height Units

New

3:59

Positioning Overview

Positioning Overview

New

1:48

Intro to 3D

Intro to 3D

New

2:25

Images & Colors

Images & Colors

New

Image Resolution

Image Resolution

New

3:28

Image File Types (GIF, PNG, SVG, JPEG)

Image File Types (GIF, PNG, SVG, JPEG)

New

2:22

Color values (HEX, RGBA, color names)

Color values (HEX, RGBA, color names)

New

3:22

Dynamic Content

Dynamic Content

New

Intro to Dynamic Content

Intro to Dynamic Content

New

1:36

SEO

SEO

New

Intro to Paid vs. Organic Search

Intro to Paid vs. Organic Search

New

1:34

Intro to 301 Redirects

Intro to 301 Redirects

New

2:39

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.