Demystifying Classes: A Guide to CSS and Webflow Styling

Jess WamaiJess Wamai
8 min read

Introduction

When I first started learning CSS and building websites on Webflow, I thought "classes" were some kind of elite HTML school club that I didn’t have the password to. Everyone kept talking about how important they were, but I couldn’t help but wonder:
What even is a class? And why do people keep giving their divs names like .hero-section or .blue-box-12 like it’s an episode of CSI?

But soon, it clicked. And when it did, it changed everything.

In this post, I’m going to break down the concept of classes in a way that actually makes sense—especially if you're new to CSS or just starting to find your way around Webflow like me.

Here’s what you’ll walk away with by the end:

  • A solid understanding of what CSS classes are (no, not school-related, I promise)

  • How classes work under the hood in regular code-based CSS

  • How Webflow makes class management visual and beginner-friendly

  • How to use combo classes to mix and match styles like a pro

  • Mistakes I made when I first started (so you don’t have to repeat them)

Whether you’re just dipping your toes into styling or you’ve already started playing with div blocks in Webflow, understanding how classes work will help you build clean, consistent, and beautiful layouts.

So grab your favorite beverage ☕, fire up your Webflow project (or VS Code if you're in the mood), and let’s finally make sense of the mysterious world of classes.

What is a Class in CSS?

Okay, let’s pretend we’ve never touched code before.

So imagine you're building a house. Every room (like the kitchen, bedroom, or living room) is a little different—but maybe you want all your bedrooms to have the same paint color, same type of window, and the same cozy rug. Instead of going into each room and decorating them one by one, you just label them all as "bedroom" and say: everything with this label should look the same.

That’s basically what a CSS class is.

Definition :

A class is a name you give to an element in your HTML, and then you use that name in your CSS to apply specific styles to it.

So instead of styling every box or button one by one, you create a class—kind of like a styling template—and apply it to as many elements as you want.


Real Example in Code

Here’s how it looks in plain CSS:

cssCopyEdit.button {
  background-color: #e63946;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
}

And here’s how you use that class in HTML:

htmlCopyEdit<button class="button">Click Me</button>
<button class="button">Learn More</button>

Now both buttons will look exactly the same—no duplicate styling, no mess.


Why use classes?

  • Reusable: You create the style once, use it anywhere.

  • Scalable: Want to change all your buttons later? Update the class, and boom—every button updates.

  • Cleaner code: Instead of stuffing inline styles all over the place, your CSS file keeps everything neat and organized.


CSS vs Webflow: What’s the difference?

In traditional coding (like above), you type everything out manually.

In Webflow, you do the same thing—but visually.
Instead of writing class="button" in code, you:

  • Click on an element

  • Go to the right-side panel

  • Type a class name like Main Button

  • Webflow creates the CSS behind the scenes

It’s all the same magic—just with less code and more clicking!

How Webflow uses Classes

When using Webflow, you might not write a even a single line of CSS… but somehow, your designs still follow styles.
How?
Because Webflow lets you create and apply CSS visually using something called classes—just like in regular code.


What Happens When You Create a Class in Webflow?

Let’s say you drag a Div Block onto your canvas in Webflow.

You’ll see a little field in the Style panel on the right that says:

"Selector" or "Style selector"

That’s where you name your class.

So you might type in something like:

cssCopyEditfeature-section

Once you do that, you can now:

  • Add padding or margins

  • Change background colors

  • Make it flexbox or grid

  • Adjust typography

And all of those styles are now connected to the .feature-section class—just like in regular CSS.

You’ve basically told Webflow:

“Hey, every time I use the feature-section class, make it look like this.”


Classes = Reusable Style Templates

You can now apply that same class to other elements—just like copy-pasting styles, but smarter.

Let’s say you styled one Div Block with:

  • 40px top/bottom padding

  • Light pink background

  • Centered content

Just drag in another Div Block, assign it the same class name (feature-section), and it’ll instantly look the same. Magic. 🪄


Why This is Helpful

  • You don’t need to repeat styles over and over again

  • If you change the class once, all other elements with that class will update

  • It keeps your layout clean and consistent


Real-World Webflow Example

Imagine you're designing a pricing page with 3 columns:

  1. Basic

  2. Pro

  3. Enterprise

All of them are boxes with white backgrounds, shadow, and spacing.
So instead of styling each column one by one, just:

  • Create a class like pricing-card

  • Style it once

  • Apply that same class to all three columns

Done. 💥


Behind the Scenes

Every time you assign a class in Webflow, it’s like writing this in CSS:

cssCopyEdit.pricing-card {
  background: white;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

…but you never see that code unless you export it.


Pro Tip:

Even though Webflow is visual, always treat your classes like code:

  • Name them clearly

  • Keep them reusable

  • Avoid overly specific names like blue-box-7

Combo Classes and Why They’re Cool

So, by now, you know that a class is like a styling label you give to an element—right?

But what happens when you want most of the same styles, plus a small tweak?
Enter: Combo Classes

Real Example in Webflow

Let’s say you have a class called:

cssCopyEditbutton

You’ve styled it with:

  • A red background

  • White text

  • Padding

  • Rounded corners

But now, you want a slightly different version for a hero section—a white button with a red border.

Instead of creating a whole new class from scratch, you:

  1. Select your element

  2. Apply the existing class: button

  3. Then, click the class field again and add a combo class: hero

Now you’ve got:

cssCopyEditbutton hero

This new combo class inherits all the styles from button, but anything you change while hero is active will apply only to elements with button hero.


Why Combo Classes Are Useful

  • Keeps your styles organized (no need to copy-paste entire styles for small changes)

  • Builds on existing work (you’re not starting from zero every time)

  • Reduces chaos (you’ll thank yourself later)


CSS Behind the Scenes

Here’s how it looks in code:

cssCopyEdit.button {
  background-color: #e63946;
  color: white;
}

.button.hero {
  background-color: white;
  color: #e63946;
  border: 2px solid #e63946;
}

Notice how .button.hero is more specific—it’s still a .button, but with its own unique twist.


A Quick Warning

Be careful not to stack too many combo classes like:

cssCopyEditbutton hero secondary blue small shadowed

This gets messy FAST. 😅
It’s better to:

  • Use clean, clear names

  • Only create combos when you really need to override something specific.

Global Classes vs Custom Edits

Alright, so you’ve made a class, maybe even a combo class, and you're feeling great.

But then something weird happens...

You make a small change to one element, and suddenly all your buttons look different.
Or maybe... you make a change and it doesn’t affect other buttons — and now you’re confused 😵‍💫

Let’s fix that confusion for good.


Global Classes

A global class is the original class you created and named—like button, card, hero-section.

Whenever you apply that class to another element, it brings all the styles with it.

If you change the class directly (like editing it in the Style panel), the changes will show up everywhere that class is used.

Think of global classes as linked outfits—change one, and the entire wardrobe updates.

Example:

  • You have 5 buttons using the button class.

  • You go into one and change the font size inside the class styling.

  • All 5 buttons will now have the new font size.


Custom Edits (Also Called "Style Overrides")

Custom edits are styles that only apply to that one element, even though it shares a class.

This usually happens when you:

  • Click an element that has a class

  • Make changes without editing the class itself

Webflow will show those styles as blue values (instead of orange), meaning:

“This is a one-time style, not part of the global class.”

Why it matters:

  • These custom edits don’t apply anywhere else

  • They can override your global class styles, which might lead to inconsistent designs later


How to Tell the Difference in Webflow

Style TypeColor in Style PanelAffects All Elements?
Global classOrange✅ Yes
Custom editBlue❌ No (just this one)

Why You Should Be Careful with Custom Edits

Custom edits are fine for small, unique tweaks, but:

  • They can pile up and make your project messy

  • You’ll forget what’s global and what’s not

  • Harder to maintain or hand off your project

✨ Pro Tip: If you find yourself doing the same "custom edit" over and over, that’s a sign it should probably be a new class or a combo class.

Conclusion

Understanding how classes work—whether in CSS or Webflow—is key to building clean, scalable, and efficient designs.

From global styles to combo classes, the ability to reuse and tweak styles with purpose is what separates cluttered projects from polished ones. And while visual tools like Webflow simplify the process, the principles behind it remain powerful and universal.

So whether you’re styling a button, structuring a layout, or building a full site, mastering classes gives you the control and consistency your projects deserve.

0
Subscribe to my newsletter

Read articles from Jess Wamai directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jess Wamai
Jess Wamai