How to Create, Edit, and Attach CSS Files to Style Your HubSpot Site

How to Create, Edit, and Attach CSS Files to Style Your HubSpot Site

When you’re building your website in HubSpot, visual consistency can easily become a challenge.

Fonts don’t match between pages, modules stack awkwardly on mobile, or a simple padding fix takes hours because you’re not sure where the problem lies. Often, these issues stem from how CSS is, or is not, managed in HubSpot’s Design Manager.

If you’ve ever struggled with styling across templates, this guide gives you clarity. 

You’ll learn how to create, edit, and properly attach CSS files in HubSpot so you can maintain control over how your pages look, function, and perform.

Whether you’re fine-tuning a single landing page or styling an entire theme, this walkthrough covers the exact steps and mechanics behind CSS in HubSpot.

Where and How CSS Is Managed in HubSpot

In HubSpot, a CSS file is a style asset stored in the Design Manager.

It acts as a central control layer for how design elements such as typography, spacing, color, and layout appear across your site.

You’ll find Design Manager under Marketing > Files and Templates > Design Tools. From there, you can upload, create, or modify CSS files. Each file can be attached to specific templates, applied globally through theme settings, or added directly to individual pages.

Most HubSpot themes ship with CSS files that handle global elements like headers, footers, and buttons. As your brand evolves, relying solely on default styles limits your flexibility. Adding your own stylesheet lets you extend or override base styles without disrupting other components.

If your team uses content staging or HubSpot’s content tools, the Design Manager keeps CSS files consistent across environments. It remains the source of record for styling across your portal.

How It Works Behind the Scenes

HubSpot CSS behaves like standard CSS, with a few platform-specific details related to file storage, caching, and delivery.

Here’s how the flow works:

Input: You write or upload a .css file in Design Manager using standard CSS syntax that targets HubSpot modules or custom elements.

Output: Once published, HubSpot hosts the file on its CDN. This version becomes available to templates and pages.

Referencing: When linked to a template, HubSpot inserts the file into the page head so styles load during rendering.

Caching: Each publish generates a new asset URL. Browsers load the latest version instead of serving outdated styles.

You can scope CSS in several ways:

  • Global application: Attach through theme settings to affect every page using that theme.
  • Template-level control: Link CSS to specific templates for campaign or layout variations.
  • Page-level targeting: Add CSS using the Additional Code field for single-page adjustments.

This structure keeps styling precise and prevents unwanted changes across unrelated pages.

Main Uses Inside HubSpot

Managing CSS correctly helps maintain clean layouts and predictable behavior across pages and templates.

Consistent Branding Across Pages

Brand consistency depends on shared rules for headings, buttons, and spacing.

A global CSS file enforces those rules without requiring manual edits on each page. If your brand colors change, updating one central stylesheet applies the update everywhere it is linked. This avoids mismatched visuals and saves time.

Custom Layouts for Landing Pages

Landing pages often need layouts that differ from the main site.

You can isolate those changes by attaching a dedicated CSS file to the landing page template. Navigation removal, tighter spacing, or different typography can live in that file without affecting other pages.

Module-Specific Styling Enhancements

Theme settings do not always cover every layout scenario.

When drag-and-drop modules display incorrectly on certain screen sizes, CSS offers precise fixes. You can target a module class and adjust spacing or width only where needed, keeping the rest of the site intact.

Common Setup Mistakes and What Causes Them

CSS issues usually trace back to a few repeat patterns.

Editing Production Theme Files Directly:
Direct edits apply immediately across all live pages.

Fix: Clone the theme or stylesheet, test changes in staging, then deploy carefully.

Not Linking CSS Files to Templates:
Unlinked files are ignored by HubSpot.

Fix: Open the template, select Linked Files, attach the stylesheet, and publish.

Overlapping Global and Local Rules:
Conflicting rules cause layout issues, especially on mobile.

Fix: Scope overrides clearly and document where each file applies.

Unused or Bloated CSS:
Large files slow page load and increase maintenance effort.

Fix: Review styles regularly and remove unused rules.

Step-by-Step Setup Guide

Before starting, confirm you have Design Manager access and know which theme your pages use.

Step 1: Open Design Manager

Go to Marketing > Files and Templates > Design Tools.

Step 2: Locate or Create a CSS Folder

Keep stylesheets inside a dedicated css folder within your theme directory.

Step 3: Create a New CSS File

Click File > New File, select Stylesheet, name it, and create the file.

Step 4: Add Your CSS Code

Write rules for typography, layout, or components using clear class names.

Step 5: Publish the File

Save and publish so HubSpot deploys it to the CDN.

Step 6: Attach the File to a Template

Open the template, access Linked Files, attach the stylesheet, and publish.

Step 7: Preview on a Test Page

Check layout and responsiveness on a staging or unpublished page.

Step 8: Adjust Through Theme Settings

For global updates, apply changes through the theme’s global CSS area.

Following these steps reduces conflicts and keeps styling predictable.

Measuring the Impact in HubSpot

CSS affects user behavior even though it is not tracked directly.

Review these indicators:

Page Performance Metrics: Bounce rate, time on page, and views in analytics.

Landing Page Conversions: Form submissions and click-through rates in performance reports.

Heatmap Feedback: Scroll depth and click behavior through tools connected to HubSpot.

Load Speed Checks: Review page optimization warnings to catch oversized stylesheets.

Design updates should align with visible changes in engagement and conversion data.

Short Practical Example

A team launches a new product landing page using an existing theme.

The spacing feels off, and the CTA buttons blend into the layout. A new stylesheet, launch-page.css, adjusts padding and button contrast. After attaching it to the template and publishing, the page reads more clearly.

Post-launch analytics show higher form submissions. The layout change improved clarity without touching other pages.

How INSIDEA Helps

Managing CSS across themes, modules, and campaigns can get messy as portals grow.

INSIDEA supports teams by setting up clean, scalable styling systems that don’t break existing pages.

  • HubSpot Onboarding: Portal setup with brand-aligned design foundations.
  • Portal Management: Ongoing cleanup and structure for design assets.
  • Design and Development: Custom themes and modules built for long-term maintenance.
  • Automation Alignment: Styling decisions that support measurable marketing outcomes.
  • Reporting Integration: Dashboards that connect layout changes to engagement data.

If your team wants to clean up CSS management and hire our HubSpot experts to align design with real usage, INSIDEA can help.

Good design works when structure, styling, and behavior stay aligned. With a clear CSS workflow in HubSpot, your pages remain consistent, readable, and easier to maintain.

Jigar Thakker is a HubSpot Certified Expert and CBO at INSIDEA. With over 7 years of expertise in digital marketing and automation, Jigar specializes in optimizing RevOps strategies, helping businesses unlock their full potential. A HubSpot Community Champion, he is proficient in all HubSpot solutions, including Sales, Marketing, Service, CMS, and Operations Hubs. Jigar is dedicated to transforming your RevOps into a revenue-generating powerhouse, leveraging HubSpot’s unique capabilities to boost sales and marketing conversions.

The Award-Winning Team Is Ready.

Are You?

“At INSIDEA, it’s all about putting people first. Our top priority? You. Whether you’re part of our incredible team, a valued customer, or a trusted partner, your satisfaction always comes before anything else. We’re not just focused on meeting expectations; we’re here to exceed them and that’s what we take pride in!”

Pratik Thakker

Founder & CEO

Company-of-the-year

Featured In

Ready to take your marketing to the next level?

Book a demo and discovery call to get a look at:


By clicking next, you agree to receive communications from INSIDEA in accordance with our Privacy Policy.