INTRO

INTRO

New

Intro to the Designer

Intro to the Designer

New

2:48

Intro to HTML & CSS

Intro to HTML & CSS

New

3:38

WEB STRUCTURE

WEB STRUCTURE

New

The Box Model

The Box Model

New

1:54

Element Hierarchy

Element Hierarchy

New

3:57

Navigator

Navigator

New

2:45

Element Basics

Element Basics

New

Element Panel

Element Panel

New

1:49

Section

Section

New

4:14

Container

Container

New

2:44

Columns

Columns

New

2:22

Div Block

Div Block

New

3:37

Components

Components

New

Intro to Forms

Intro to Forms

New

4:55

Navbar

Navbar

New

9:38

Slider

Slider

New

4:56

Symbols

Symbols

New

3:47

Styling Basics

Styling Basics

New

Intro to Style Panel

Intro to Style Panel

New

3:15

HTML Tags

HTML Tags

New

3:59

Classes

Classes

New

2:46

Combo Classes

Combo Classes

New

4:05

States

States

New

2:47

Layout

Layout

New

Intro to Web Layout

Intro to Web Layout

New

2:27

Padding & Margin

Padding & Margin

New

2:48

Display Settings

Display Settings

New

2:54

Intro to Flexbox

Intro to Flexbox

New

2:27

Grid layouts overview

Grid layouts overview

New

4:18

Positioning Overview

Positioning Overview

New

1:48

Responsive Design

Responsive Design

New

Intro to Responsive Design

Intro to Responsive Design

New

2:21

Intro to Breakpoints

Intro to Breakpoints

New

16:00

16:00

INTERACTIONS CORE CONCEPTS

INTERACTIONS CORE CONCEPTS

New

Triggers & animations

Triggers & animations

New

4:31

CMS & Dynamic Content

CMS & Dynamic Content

New

Intro to Dynamic Content

Intro to Dynamic Content

New

1:36

Intro to Webflow CMS

Intro to Webflow CMS

New

2:02

CMS Collections

CMS Collections

New

2:05

Collection List

Collection List

New

3:33

Filtering Collection Lists

Filtering Collection Lists

New

2:47

Collection Page

Collection Page

New

3:01

Using the Editor

Using the Editor

New

2:22

CMS Collection Fields

CMS Collection Fields

New

Plain Text Field

Plain Text Field

New

0:51

Rich Text Field

Rich Text Field

New

1:16

Image Field

Image Field

New

1:24

Switch Field

Switch Field

New

0:58

Reference Field

Reference Field

New

1:11

Multi-reference Field

Multi-reference Field

New

2:31

new course
CSS grid landing page tutorial (36min)

Lesson info

Lesson info

Making manual style changes to each and every element is tedious and time-consuming. And entering repetitive values for hours and then trying to update those values one by one can be frustrating. Classes save styling information that you can apply to as many elements as you want throughout your project. 

Here we’ll cover:

  1. ‍Creating classes
  2. ‍Applying classes
  3. ‍Editing classes
  4. ‍Creating class variants by duplicating classes or by adding combo classes

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

Making manual style changes to each and every element is a pain. It takes a ton of time to enter repetitive values, and once you've done that, changes to those values can seem even more frustrating. Classes contain styling information, and you can apply these classes to as many elements as you want throughout your project.

We have three things to cover here — really straightforward: creating classes, applying classes, and editing classes. Let's create a class.

Now this page has a number of sections, and each section has a heading inside at the top. These headings have been dragged right in — nothing has been applied — nothing has been styled. So we're styling from scratch.

With our element selected, we can begin styling right away. We can make changes to our layout like margin. We can adjust typography — maybe choose a different font or adjust the font color. We can adjust all sorts of style values.

The big takeaway here is that the moment we began styling, a class was automatically created. And when we intend to reuse (or even just organize) this class, we can double click it to rename. Let's call this Best Heading Ever. And you can call it whatever you want.

As an alternative, you can select any element that doesn't have a class applied, and instead of styling first, you can actually start by clicking in and naming a new class.

That's creating classes.

Applying classes is where things start to get interesting. Now we can see inside our Selector field that this element — this heading — has the Best Heading Ever class applied. But right now, this is the only element that's using that class.

So let's go down to another heading and select that one. And if we click inside our Selector field, we can type in Best Heading Ever. Hit Enter. And the class has been applied.

Let's do it again to this heading. This time, we can see the class name appears as we start typing it out, so we can use the keyboard arrows or the mouse to select our class.

Now what if an element already has a class? Here's a heading which already seems to have a different class listed in the Selector field. If we hover over and click on the down arrow, we can remove that class. And just the like the others, we can click inside and apply our Best Heading Ever class.

That's applying classes.

Finally, let's edit our classes.

Once a class has been created, we can select any element that's using our Best Heading Ever class.

When we go in and make a change, that change affects all instances where that class is used throughout the project. No more manually changing each and every tiny detail. You do it once. Classes do the heavy lifting.

And if we want to rename our class? Maybe it deserves a promotion? Again, just double-click, and type the new name. This will change the name of the class throughout the project.

So, we can create classes which contain all our style information. We can apply classes to as many elements as we'd like. And of course, we can edit the styling on these classes, and those changes will affect the styling on each and every element that's using that class.