How to Add CSS to HubSpot Email Templates

How to Add CSS to HubSpot Email Templates

If your emails do not fully reflect your brand’s visual identity, or worse, appear misaligned or broken on certain devices, you are not alone.

HubSpot’s drag-and-drop tools help teams move quickly, but they offer limited control over styling. Without custom CSS, teams often struggle with fonts, spacing, and colors, adjusting the same elements repeatedly to get close to the desired look.

This issue becomes more visible for marketing and design teams managing multiple campaigns each month. Repeating small style changes increases effort and introduces inconsistencies. 

A more reliable solution is to understand how HubSpot handles CSS and how to add it correctly to the email template’s head section.

This guide explains how to add CSS to the head section of HubSpot email templates, why it matters, and how to test your changes to achieve better visual consistency across devices.

Managing Email Styles with Head-Level CSS in HubSpot

Each HubSpot email template consists of modules, layouts, and underlying styling rules. The header section of a template controls global styling elements, such as font families, colors, and layout behavior, that apply to the entire email.

This section is especially important because most email clients, including Gmail and Outlook, do not support linked external CSS files. Instead, they rely on inline styles or limited head-level CSS that is processed during email delivery.

HubSpot allows approved <style> tags within the head section using Design Tools. These styles sit above the body content in HTML and HubL templates and are compiled into the final email output.

To access this area:

  1. Go to Marketing > Files and Templates > Design Tools.
  2. Select a coded email template.
  3. Open the template in HTML + HubL view.
  4. Add your CSS within the <head> tag.

If you are working with a drag-and-drop template, the head section is not visible. However, you can still inject style rules using custom modules or embedded HubL blocks that HubSpot processes before sending the email.

How It Works Under the Hood

To use CSS effectively in HubSpot emails, it helps to understand how the platform compiles and sends emails after styles are added.

The process works as follows:

  1. HubSpot processes the template structure and HubL references.
  2. All HTML and HubL code is compiled into a final email layout.
  3. Valid CSS added to the head section is merged into the final output.
  4. Inline styling logic is applied to improve compatibility, especially for Outlook, which often ignores head-level styles.

Inputs:

  • Email template written in HTML and HubL
  • Embedded <style> rules

Outputs:

  • A styled HTML email with head-based and inline styles applied

You can review the output using HubSpot’s preview and test email tools.

Optional configuration allows you to:

  • Target specific elements using classes or IDs
  • Avoid unsupported CSS features such as animations
  • Apply inline fallback styles where head-based CSS may be ignored

Understanding this workflow reduces rendering issues and limits the need for last-minute layout fixes.

Main Uses Inside HubSpot

Maintain Brand Styling Across Templates

When brand guidelines define fonts, colors, and button styles, every email should follow the same rules regardless of who builds it. Adding global styles to the head section ensures all modules inherit these settings automatically.

Example:

<style>

h1, h2, h3 { 

  font-family: ‘Helvetica Neue’, Arial, sans-serif; 

  color: #333333; 

}

</style>

This approach reduces repetitive styling work and helps new team members stay aligned with brand standards without memorizing detailed specifications.

Improve Mobile Responsiveness

Emails must display clearly across screens of different sizes. Media queries in the head section allow layouts to adapt to device width, which is especially important for tablets and smartphones.

Example:

<style>

@media only screen and (max-width: 600px) {

  .col-half { width: 100% !important; }

}

</style>

This ensures multi-column layouts stack into readable rows on smaller screens. With mobile accounting for a large share of email opens, responsive behavior directly affects readability and engagement.

Add Custom Hover Effects for Interactive Elements

Some email clients support basic hover states for links and buttons. Adding these styles in the head section introduces subtle interactivity without using scripts.

Example:

<style>

.btn-primary:hover { 

  background-color: #0056b3 !important; 

}

</style>

This helps call-to-action buttons stand out while keeping the design controlled and predictable.

Common Setup Errors and Wrong Assumptions

If CSS styles do not behave as expected, one of the following issues is often the cause:

  • Adding linked CSS files: Most email clients ignore <link> tags. Always embed styles inside a <style> tag.
  • Using unsupported selectors: Complex selectors and pseudo-classes are often stripped. Simple selectors are more reliable.
  • Ignoring inline style overrides: HubSpot applies inline styles that may override head styles unless !important is used carefully.
  • Missing mobile meta tags: Responsive rules require a viewport meta tag in the head section.

Example viewport tag:

<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>

Recognizing these issues early helps reduce testing cycles and rework.

Step-by-Step Setup or Use Guide

Follow these steps to add CSS to the head section of your HubSpot email template:

  1. Log in to HubSpot and go to Marketing > Files and Templates > Design Tools.
  2. Open the folder containing your email template, then select it.
  3. Switch to HTML + HubL mode.
  4. Locate the <head> tag at the top of the file.
  5. Add your CSS inside a <style> tag.

Example:

<style>

body { font-family: Arial, sans-serif; }

.cta-button { 

  background-color: #008CBA; 

  color: #fff; 

  padding: 10px 20px; 

}

</style>

  1. Click Publish to Email.
  2. Use Send Test Email or Preview to review the output across devices.
  3. Adjust styles based on rendering results.

For drag-and-drop templates, place your CSS inside a custom module that outputs a style block. HubSpot automatically inlines supported rules during processing.

Measuring Results in HubSpot

After applying CSS updates, review performance to confirm that visual changes support engagement.

Track the following:

  • Email performance reports: Improvements in click-through or open rates can reflect clearer layouts or stronger CTA visibility.
  • Device-level engagement: Changes in mobile performance often indicate responsive CSS is working as expected.
  • A/B tests: Compare styled versions against earlier designs to measure differences in interaction.
  • Engagement trends: Monitor engagement over time to confirm design updates do not cause confusion or fatigue.

Post-send checklist:

  • Review previews in Gmail, Outlook, and Apple Mail.
  • Confirm responsive behavior after updates.
  • Check font size and color contrast for accessibility.
  • Monitor unsubscribe rates following design changes.

Short Example That Ties It Together

A B2B software marketing team notices that their monthly newsletter looks inconsistent. Fonts vary, spacing feels uneven, and mobile layouts break in certain sections.

The team updates the HTML and HubL template and adds the following CSS to the head section:

<style>

h2 { color: #1D3557 !important; font-weight: 600; }

.cta-button { background-color: #457B9D; border-radius: 6px; }

@media only screen and (max-width: 600px) {

  .two-col { width: 100% !important; }

}

</style>

After publishing and testing, headings align with brand guidelines, CTAs appear clearer, and columns stack correctly on mobile devices.

Analytics show higher mobile click activity and steadier engagement after the update, confirming that small changes to the header can improve how emails are received and used.

How INSIDEA Helps

Managing email styling inside HubSpot requires a clear understanding of how templates, CSS, and rendering rules work together. INSIDEA supports teams that want reliable, brand-aligned email execution without the constant trial-and-error.

INSIDEA’s HubSpot Consulting Services cover areas such as:

  • HubSpot Onboarding: Structuring portals and templates correctly from the start
  • Email Template Styling: Applying controlled CSS for consistent and responsive layouts
  • Design Tools support: Organizing templates, modules, and global styles
  • CRM Alignment and Reporting: Connecting email performance to broader reporting needs
  • Workflow support: Building automation that supports ongoing campaigns

If your team wants email templates that remain consistent across campaigns and devices, it helps to hire HubSpot experts who understand both the technical and operational sides of the platform.

INSIDEA works alongside marketing teams to keep HubSpot email templates structured, readable, and scalable as programs grow.

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.